Perhaps taking their lead from the Matt Damon film ‘The Martian,’ a team of biologists are developing the technology to grow everyday vegetables in space. The technology also has a surprising use here on Earth.

Earlier this year NASA outlined plans to reach Mars between 2030 and 2040, however, humans face a range of obstacles before we can survive on the Red Planet. Chief among them is what we will eat when we get there. Constant access to fresh food will be essential to ensure that space explorers remain healthy and productive while working in the hostile terrain.

“We're not leaving this planet without green plants, at least we're not going very far and we're not staying very long,” Mike Dixon of the University of Guelph’s Controlled Environment Systems Research Facility (CESRF) explained.

A team of researchers at the facility have been busily trying to solve this problem. The work includes understanding how plants can function under environmental conditions such as very low atmospheric pressures and a lack of oxygen.

“Oddly enough, space [for crop production] in space is limited,” another CESRF scientist, Thomas Graham, noted in a statement. “Plants must be small without sacrificing production if they are to be viable candidates for life-support systems in space.”

To overcome these restraints the team has developed a special chamber, affectionately referred to as ‘The Fridge.’ The system is a version of what will eventually accompany astronauts on the first mission to mars.

As the team waits for manned missions to Mars to finally take off, the technology isn’t being let sit idle, instead it’s being used to grow marijuana.

“All the technologies required to [grow fresh food in space] are being deployed in the service of growing really good marijuana,” Dixon told Motherboard.

Because of the extraordinary cost of space travel, Dixon says it’ll be a long time before astronauts will be growing marijuana, or any vegetable, that can’t be eaten in space. However he does think it could happen one day.

“They’re going to grow barley and make single malt whiskey at some point. Why not marijuana?”