While policymakers argue about things like background checks for legal gun purchases, criminals, for the most part, are not getting guns through legal means, according to Philip J. Cook.

Cook, a researcher at Duke University, has been tracking the underground gun market in America for the last 15 years. For one project, his team went to one of the largest jails in the country and asked the inmates one simple question: where do you get your guns?

They talked to 99 inmates, which is remarkable, Cook says, in part because “anything that they told us about how they got a gun was basically going to be a confession of a crime that they’d committed.”

Easy as getting a beer

Samuel is a former gang member from Chicago. He says if you’re connected to a social network like a gang, it’s easy to get a gun. In his experience, getting a gun was as easy as getting a beer. Usually he didn’t even have to pay for the gun.

“You know you didn’t have to pay because whoever was in your gang that’s really leading the gang, they would have that connection,” Samuel says.

One thing that’s clear from Cook’s research is that something needs to be done to stop the flow of guns into urban neighborhoods like the one Samuel grew up in. And lawmakers can do something about this.

For example, laws designed to regulate legal gun sales can significantly affect the underground market. After Maryland passed a Firearm and Safety act in 2013, 41 percent of surveyed parolees in the state reported that it was more difficult to get a handgun.

And a study of over three decades of data on handguns recovered in Boston shows that fewer guns are illegally obtained from states where people are restricted to legally buying just one gun a month.

Going after the source

Cook argues for a change in the way law enforcement does its job.

“When a gang member or another dangerous person gets picked up that has a gun there needs to be a lot of questions asked about where that gun came from, what their source is,” he says.

If detectives spent time tracking down the history of the gun, Cook says, law enforcement could go beyond simply catching one perp with one gun. Rather, police might be able to arrest the person who sold that gun—and presumably other guns—into the underground market.