With 33 states and the District of Columbia having legalized marijuana in some form or another, law enforcement officials have been grappling with how to assess whether someone is driving while high on weed. Blood and urine tests have proven totally unreliable, leaving it up to an officer's discretion whether or not someone has been driving while baked.

That may change with the introduction of a device which can detect how much THC is in one's breath, according to NPR. While the device still needs to undergo rigorous testing and research to correlate its results with intoxication, the fact THC can be detected in breath at all is a major step towards that future.

Last week, a team of researchers at the University of Pittsburgh announced the latest tool to detect THC — delta-9-tetrahydrocannabinol, the main psychoactive component in pot — in breath. The university's Star Lab, led by Alexander Star, began developing the box-shaped device in 2016, in the midst of a wave of pot legalization across the United States. Star, a chemistry professor, partnered with Ervin Sejdic, a professor of electrical and computer engineering who's also at the university, to build the prototype. The device uses carbon nanotubes , which are 1/100,000 the size of human hair, to recognize the presence of THC, even when other substances are in the breath, such as alcohol. The THC molecule binds to the surface of the tubes, altering their electrical properties. -NPR

"Nanotechnology sensors can detect THC at levels comparable to or better than mass spectrometry, which is considered the gold standard for THC detection," according to a Swanson School of Engineering press release.

And according to NPR, the devices are ready for mass production.

"If we have a suitable industrial partner," Alexander Star told Here & Now's Jeremy Hobson, adding "then the device by itself would be quite ready in a few months."

All that's left to do would be to test the prototype and prove that it correlates with how stoned a person is beyond a shadow of a doubt. Until they can figure out a reliable measurement system, the device will be useless to law enforcement.

With alcohol, you can figure out impairment by measuring the amount of alcohol in someone's blood, which you can determine from a Breathalyzer using the "blood to breath," or "partition," ratio. Make that translation from breath to blood to brain, and you have a relatively accurate sense of how drunk someone is. "So when it comes to these marijuana breath tests, that's the million-dollar question right now," says Chris Halsor, a Denver lawyer who focuses on issues around legal cannabis. Is there a ratio that links the amount of THC in someone's breath to the amount in the person's blood — and then to exactly how stoned that person is? No, says Sejdic. The correlation "is basically missing, from a scientific point of view." -NPR

The device also has a built-in threshold which will only allow for the detection of a certain amount of THC - which somehow avoids the problem of flagging past pot use from several days prior.

Moreover, lawmakers will have to decide what level of THC in one's blood is too high for driving.

It took American courts several decades to settle on today's blood alcohol concentration limit of 0.08%. States have already set various legal guidelines, though some scientists argue that none of them are backed by hard science. Halsor, who has taught police about marijuana DUIs for years, says some officers whom he works with are hesitant about the devices. They worry that a cop with less training might use one as a crutch "instead of actually evaluating the individuals and looking at how they're performing physically, mentally and cognitively," Halsor says. -NPR

Until this device - or others like it, are proven reliable - it looks like it'll be up to a police officer's discretion for the time being.