Scientists are turning brewers yeast (Saccharomyces cerevisiae) into tetrahydrocannabinol (THC), the psychoactive compound found in cannabis, and cannabidiol (CBD), the legal compound gaining popularity in a variety of food, beverage, and health products.

The recent discovery, reported in Nature on Wednesday, is nothing short of a miracle. The process involves turning a sugar found in brewers yeast, galactose, into cannabinoid compounds. The goal of the research is to enable THC and CBD production without plant-based cultivation.

Although previous research has been done on the subject with a similar aim, this study is the first to prove the transformation can happen inside a single cell, “which is cool,” Kevin Chen, chief executive of Hyasynth Bio in Montreal, Canada, said. Hyasynth is one of 10 or more companies “working to produce cannabinoids in engineered yeast, bacteria, or algae,” Nature reports.

The bio-hack could change the cannabinoid marketplace, allowing less expensive production of compounds such as CBD and THC that is commercially viable to sell to pharmaceutical companies and the public.

Beer yeast may be the most exciting way to create cannabinoids we’ve heard of, but it’s not the only one: A research team at the University of California, Los Angeles engineered a process for turning sugar into CBD without the transformation needing to occur in the cell. Meanwhile, University of California, Berkeley biologist Jay Keasling and his team said the beer yeast cell transformation required “16 genetic modifications.”

Hopes are high for THC and CBD made from beer yeast, but analysts predict the process won’t be cost effective for at least 18 months to two years.