As more states in the United States legalize marijuana consumption — or set up votes for it —  whether only for medical reasons or for recreational use as well, there are also growing concerns about people getting in their vehicles and driving while under the influence of cannabis intoxication. And now, there just might be a practical way to check for marijuana DUI.

Researchers from Stanford University have engineered a device they are calling a “potalyzer” which, using magnetic nanotechnology, could be a roadside test for THC levels in drivers’ bodies. Tetrahydrocannabinol, or THC as it is commonly known, is the primary psychoactive ingredient in cannabis, and is usually tested in a laboratory using blood or urine samples. That method is not an effective one for spot checks by police for obvious reasons.

A team of Stanford researchers, led by Shan Wang, have “created a mobile device that uses magnetic biosensors to detect tiny THC molecules in saliva. Officers could collect a spit sample with a cotton swab and read the results on a smartphone or laptop in as little as three minutes,” according to a statement on Stanford’s website.

The “potalyzer” not only detects the presence of THC in the saliva but can also measure its concentration.

Other than the convenience, researchers also chose to test saliva as it “may correlate with impairment better than THC in urine or blood.”

The magnetic nanotechnology used by Wang’s team to develop the “potalyzer” is used for screening cancer. They combined that technology with a biochemical technique called immunoassaying, in which a molecule is detected within a solution by introducing its antibody that will bind only with that molecule.

Researchers are still working on “creating a user-friendly form factor for the device, which would need to go through field tests and be approved by regulators before it can be deployed by police.”

It should be noted that there is still no consensus on how much THC is too much when it comes to driving.

A paper describing the THC detection device was published in the journal Analytical Chemistry. The authors said the same device could be used to test for multiple compounds, such as “morphine, heroin, cocaine or other drugs.”