One of the biggest issues with putting astronauts on Mars for any length of time is the planet’s weak atmosphere and the lack of oxygen needed to sustain life. Astronauts would need to wear spacesuits almost constantly to live and work on Mars.

However, a team of researchers at the California Institute of Technology may have come up with a solution for this conundrum – the astronauts could generate their own oxygen at will.

Published in the journal Nature Communications, the researchers looked at comets, which generate molecular oxygen and discovered that oxygen can be produced with carbon dioxide reactions. The researchers crashed the carbon dioxide into gold foil and the foil emitted molecular oxygen. The foil cannot be oxidized and should not produce any molecular oxygen, but nonetheless, it did.

“At the time we thought it would be impossible to combine the two oxygen atoms of a CO2 molecule together because CO2 is a linear molecule and you would have to bend the molecule severely for it to work,” Konstantinos Giapis, a professor of chemical engineering at Caltech, said in a statement. “You’re doing something really drastic to the molecule.”

Molecular oxygen is the two atoms of oxygen that come together to form breathable air.

Giapis, along with former Caltech postdoctoral fellow Yunxi Yao, noted just how rare this type of reaction is in the study, calling it “exotic” and “rarely observed even with extreme optical or electronic excitation means.”

Comets are also able to create molecular oxygen using kinetic energy, where the solar wind pushes floating water molecules into the comet’s surface, according to Space.com.

To understand how the carbon dioxide broke down into the molecular oxygen, the researchers created a computer simulation which showed the “excited molecules” (excited meaning vibrating and rotating around to an enormous degree) moving around in complex ways.

“In general, excited molecules can lead to unusual chemistry, so we started with that,” Caltech chemistry professor Tom Miller added in the statement. “But, to our surprise, the excited state did not create molecular oxygen. Instead, the molecule decomposed into other products. Ultimately, we found that a severely bent CO2 can also form without exciting the molecule and that could produce O2.”

The device Giapis created works similar to a particle accelerator, according to the statement, giving a charge to the carbon dioxide molecules and turning them into ions. But anything with enough velocity could yield the same result, he added.

“You could throw a stone with enough velocity at some CO2 and achieve the same thing,” he said. “It would need to be traveling about as fast as a comet or asteroid travels through space.”

Of course, the potential applications for this are exciting, given that Mars is not exactly a walk around a block, 33.9 million miles from Earth at its closest point and 250 million miles at its furthest point.

This may help explain why there have been small traces of oxygen seen high in the Martian atmosphere. Giapis hopes that eventually the CO2 in Earth’s atmosphere could be turned into oxygen, even if the yields are low, at just one or two oxygen molecules for every 100 CO2 molecules.

“Is it a final device? No. Is it a device that can solve the problem with Mars? No. But it is a device that can do something that is very hard,” Giapis said. “We are doing some crazy things with this reactor.”