The Las Vegas shooter Stephen Paddock went on a gun-buying spree before he committed his massacre on Sunday night, purchasing 33 weapons in a 12-month period, most of which were rifles.

His rapidly assembled arsenal has led some Americans to wonder: How is it possible to acquire so many guns, so quickly, and not raise flags with law enforcement?

The answers lie in the many gaps in federal regulation.

The Bureau of Alcohol, Tobacco, Firearms and Explosives is forbidden by Congress from creating any kind of gun registry. Academic surveys have shed light on the purchasing habits of the small number of “super owners’ who acknowledge collecting dozens of guns, but the federal government has no way of knowing their identities.

The ATF does monitor certain kinds of sales that can be suggestive of gun trafficking. Licensed firearm dealers around the country are required to notify the agency when they sell more than two handguns to the same customer within five consecutive days. Traffickers can get around the rule, however, by spreading out purchases, using intermediary “straw purchasers,” or just stealing unsecured weapons.

In most of the country, the ATF doesn’t make any kind of effort to keep track of bulk sales of rifles like those Paddock used in Las Vegas. The only exception is in four states along the border with Mexico: Texas, New Mexico, Arizona, and California. In 2011, the Obama administration instated a rule requiring gun sellers in those states to report anyone who buys more than one semiautomatic rifle chambered to shoot rounds larger than .22 within five consecutive days.

Some states do more to keep track of residents who accumulate many guns. According to the Law Center to Prevent Gun Violence, California, Connecticut, Hawaii, Massachusetts and the District of Columbia require gun dealers to notify law enforcement of every single gun sale. Maryland, Michigan, New Jersey, New York, Pennsylvania, and Washington mandates that gun dealers report handgun sales, but not the sale of long guns. Eleven states and the District of Columbia require gun dealers to retain records of every sale for between three and 20 years.

The rifle-reporting rule for border states was instated not to prevent mass shootings, but to combat gun trafficking to Mexico. While assault-style rifles like those Paddock hoarded are rarely used in crimes domestically, transnational drug-trafficking cartels are known to favor them, and the guns are easier to get in the United States than anywhere else in the hemisphere. American weapons smuggled in this way have been implicated in an epidemic of criminal violence south of the Rio Grande, fueling an ongoing migrant crisis.

USA Today reported that records of Paddock’s purchases were spread across two states subject to the rifle-reporting rule — California and Texas — as well as Nevada and Utah. No details of Paddock’s purchases in Texas or California have yet come to light, but interviews with gun dealers who sold Paddock weapons in the other two states suggest that he generally bought one rifle at a time. 

If Paddock held to that modus operandi wherever he purchased weapons, his activity would not have been recorded. 

The rule requiring reporting the sale of multiple rifles in border states is temporary, and has been renewed once, in 2014. It expires on November 30. 

The National Rifle Association has fought unsuccessfully  to have the rule tossed out in court. Since at least 2012, Republicans in Congress have included riders in budget bills funding the ATF to effectively scrap the rifle-reporting requirement. 

Before the shooting last Sunday, another effort to permanently reverse the rule was afoot. The House of Representatives passed a budget bill with such a rider in mid-September.

The White House said that it would sign the budget before it passed the House. It awaits a vote in the Senate.