A few shots of tequila might be a shitty decision on a Friday night, but for a world made hotter and drier by climate change, tequila might be exactly what the doctor ordered.

Well, not quite what you’re guzzling on a raging Friday night — scientists at the Department of Energy’s Oak Ridge National Laboratory are attempting to reverse engineer plants with the unique molecular architecture of agave (the plant whose fermented juices give us the gift of bleary nights at da clurb.

That’s because the agave plant is a bit of a unicorn among its brothers and sisters in the plant kingdom. Because it hangs out in semi-arid climates, the agave has adapted to thrive on very little rainfall thanks to a special photosynthesis system crassulacean acid metabolism, or CAM. CAM takes in carbon dioxide through open pores at night, stocking it away for hot, dry days when the pores clam up so that it’s not only able to absorb sunlight, combine it with carbon dioxide, and produce energy, but also — and here’s the important drought part — do so without losing precious water.

Oddly, CAM was just a fun fact for botanists back when it was first discovered in the 1950s, but modern researchers trying to deal with the realities of a toasty planet had an Aha! moment and figured the agave plant was maybe something we should imitate for the future of agriculture.

“Today’s demand on agricultural systems to provide food, feed, forage, fiber and fuel call for more comprehensive research into understanding the complexities of CAM plants,” ORNL’s Xiaohan Yang said in a press release. “As we uncover each layer of the CAM process, our studies aim to speed up the evolution of crops to give them the ability to thrive in more arid environments as the availability of freshwater becomes limited.”

Scientists are currently trying to figure out exactly what genetic cues tip CAM plants off to open and shut their pores, and how they know to do it at sunset and sunrise. Once they do, the hope is to start creating rice, corn, poplar, and switchgrass plants that would be able to withstand our future steamy world. That’s news worth taking another misguided shot.

Photos via Pexels