Cacao to cacao.

Chocolate is good and climate change is bad, so naturally the latter is predicted to eradicate the former. Scientists forecast that reduced humidity, caused by rising temperatures, will make cacao trees extremely vulnerable by 2050, threatening the chocolate industry. Luckily for cacao farmers and chocolate fiends, researchers are attempting to save the bean-like seeds with CRISPR, the same gene-editing technology associated with creating “designer babies,” eradicating diseases, and bringing back the wooly mammoth.

According to a report published Sunday by Business Insider, scientists at the University of California, Berkeley and the global confectionary company Mars are collaborating to create cacao plants that can survive in warmer temperatures and drier conditions. Scientists at the university’s Innovative Genomics Institute are using CRISPR to modify the DNA of the plants, enabling them to grow in different elevations while being disease-resistant.

A farmer with the cacao plant.

The ability to grow in varying elevations is key: According to a 2016 report released by the National Oceanic and Atmospheric Administration, cacao trees can only grow within 20 degrees north and south of the equator, and they need high humidity, abundant rain, nitrogen-rich soil, and steady temperatures to thrive. Scientists predict that rising temperatures and moisture loss will affect the three countries that lead cacao production: Côte d’Ivoire, Ghana, and Indonesia.

“By 2050, rising temperatures will push the suitable cacao cultivation areas uphill,” the report reads. “The IPCC [Intergovernmental Panel on Climate Change] reported that Côte d’Ivoire and Ghana’s optimal altitude for cacao cultivation is expected to rise from 350-800 feet to 1,500-1,600 feet above sea level.”

The suitability for cacao production (left) and project fro 2050 (right).

CRISPR, which stands for Clustered Regularly Interspaced Short Palindromic Repeats, is a tool that allows researchers to target genetic code and precisely edit DNA. Jennifer Doudna, Ph.D, a biochemist at UC Berkeley who is overseeing the collaboration with Mars, is one of the scientists involved in the heated patent debate over who actually invented CRISPR.

Dounda told Business Insider that, while her tool has become famous for its implication for human genetics, it is more likely to have a serious effect on food. Many of the research projects associated with her lab are designed with a focus on using CRISPR to protect crops from climate change, which in turn will help protect financially vulnerable farmers.

This project is also a part of Mars’s larger initiative, a $1 billion pledge to reduce the carbon footprint of its business and increase the sustainability of the crops used in its products. In 2008, Mars launched the Cacao Genome Project, an effort to publicly release the sequence of the cacao gene so breeders could “begin identifying traits of climate change adaptability, enhanced yield, and efficiency in water and nutrient use.”