The Air Force Academy's chemistry department is cooking up a formula that could lead to better drug testing for synthetic marijuana.

The project underway at the school is boiling down the drug, known as "Spice" to come up with a pure sample of the residue it leaves in the body.

"It's like chemical legos," explained Timm Knoerzer, a professor who is working with senior cadet Jacob Krimbill to build the compound.

The synthetic drug acts like marijuana in the brain, mimicking the drug's impacts. But it relies on several different chemical formulas than cannabis.

In recent years, the drug has been used by some airmen as alternative to marijuana that's more difficult to detect.

Krimbill became interested in the project last summer while working as an intern in the Air Force's drug testing laboratory in San Antonio, Texas.

The key to finding spice use is detecting the remnants of the drug after it undergoes metabolic changes driven by the chemistry of the human body.

"We're making a metabolite," Krimbill said.

If a pure sample of the metabolite can be built, it can be use to tune drug tests to catch the drug. It would lead to a more reliable test that can detect use weeks after the fact.

By recreating human processes in a laboratory setting isn't easy.

Krimbill has spent weeks trying to build the molecule.

"We're putting pieces together to get what we want," Knoerzer explained.

So far, the pair has put together several pieces of the puzzle-like molecule, but work continues to fully recreate it - one particular chain of atoms is proving tough to attach.

To determine whether they've got the right formula, the chemical samples are submitted to a battery of tests, including analyzing it as a gas.

"I'm a biochemist, so this is right up my alley," Krimbill said.

Krimbill, who will attend medical school after he graduates from the academy in May said the laboratory work has shown him how complex the chemistry of the human body can be.

"I really like the way chemistry and the body are tied," he said.

Knoerzer, who has a doctorate in pharmaceutical chemistry said working on the synthetic marijuana compound could lead to further research at the academy into the interactions between chemistry and the body.

"There are ways we can leverage this idea," he said.

The work is funded by federal research grants. It's one of scores of similar projects at the academy, which prides itself on research run by cadets.