We’ve got good news and bad news. The bad news is that you really can’t trust the drug content listed on the labels of edible marijuana products. The good news is that someday you will be able to. A team of scientists has come up with a new technique for measuring the drug content of pot brownies, cookies, and gummy bears. They presented their research yesterday, March 15, at the annual meeting of the American Chemical Society.

Right now, your breakfast cereal is probably subject to more rigorous inspection and standards than any pot you could buy at a retailer or dispensary. Legislators across the country are decriminalizing pot use before implementing guidelines or quality regulations. The responsibility for quality control has therefore fallen on the shoulders of growers and distributors. But even those who want to test their products are having a hard time getting consistent results.

“Producers of cannabis edibles complain that if they send off their product to three different labs for analysis, they get three different results,” researcher Melissa Wilcox said in a press statement.

The information is hard to come by. Marijuana has, until very recently, been very illegal—which meant that even getting samples to study was near-impossible. As a result, pot science has to run to catch up with America’s new landscape, and the results have been spotty. And without consistent quality control, things kind of fall apart.

Last year, chemists tested 75 edible products purchased from dispensaries in California and Washington State. Of those, only 17 percent were accurately labeled. A full 60 percent of the products were over-labeled, meaning that they claimed to contain more THC (tetrahydrocannabinol, the chemical responsible for most of marijuana's psychoactive effects) than they really did. And 23 percent of the foods were under-labeled, meaning that they were more potent than advertised.

Both over- and under-labeling are serious problems, not just for consumers wanting to get their money’s worth, but also for users of medical marijuana, for whom accurate dosing is extremely important. Too little drug will not help with their symptoms; too much could do them harm.

Accurate measurement of dosing is especially important for edible products, which release the drug more slowly than other delivery methods.

“It’s a lot easier for an individual to control their dose when smoking,” Wilcox said. “The effects of edibles can take a while to happen. You eat them, and then wait to see how you feel in an hour or two. If you ingested too much, you could be in for an unexpectedly bad experience.”

Why is quantifying drug content in snacks so hard? The cannabis plant itself is easy enough to test, but when you add flour, sugar, and butter, things get complicated. Most labs use a machine called a high-performance liquid chromatograph (HPLC). But HPLCs were designed to handle refined chemicals, not baked goods.

“These machines were never designed for you to inject a cookie into them,” researcher Jahan Marcu explained in the press statement. “The sugars, starches, and fats will wreak havoc on HPLC equipment. They can really muck up the works and lead to inaccurate results.”

So Marcu, Wilcox, and their colleagues decided to find another way. They settled on a five-step protocol. Step one is placing a cannabis-infused edible in a cryo-mill with dry ice or liquid nitrogen and grinding it. Step two is adding diatomaceous earth (soil made from the fossilized remains of tiny organisms called diatoms). Step three is grinding the mixture into a powder. Step four is using a process called flash chromatography to separate the food’s chemicals and extract just the cannabinoids (THC and CBD). Finally, step five is running just the drugs through the HPLC.

It may be complicated, but it works—consistently. The researchers are currently investigating whether the process works for all pot-infused food and drinks. If it does, the next step will be implementation in commercial labs across the country.