Scientists have begun actively preparing for the end of the world. A group of experts met in the Arizona desert to discuss potential nightmare scenarios that could take place in the future and how humanity might handle them, Bloomberg reported Thursday.

Funded by Tesla co-founder Elon Musk and Skype co-founder Jaan Tallinn, the meeting was comprised of 40 scientists, policy analysts and cyber security experts. The group was tasked with coming up with increasingly likely “doomsday scenarios.”

“There is huge potential for AI (artificial intelligence) to transform so many aspects of our society in so many ways. At the same time, there are rough edges and potential downsides, like any technology,” Eric Horvitz, an artificial intelligence scientist and the co-organizer of the meeting, told Bloomberg. “To maximally gain from the upside we also have to think about possible outcomes in more detail than we have before and think about how we’d deal with them.”

The group was split into two opposing teams: the blue team, the defenders, and the red team, the attackers. Each was tasked with developing realistic, future scenarios that could impact humanity, like a stock market manipulation event or cyber-attacks on self-driving cars. The best pitches were then discussed alongside possible solutions.

GettyImages-632763374 Scientists announced that the Doomsday Clock moved so that humanity was "30 minutes to midnight" at a press conference in Washington D.C., Jan. 26, 2017. Photo: Getty Images

The gathering came at an appropriate time. Scientists announced in January that the Doomsday Clock, a metaphorical clock assessed by the Bulletin of Atomic Scientists that represents how many “minutes” to minute, moved so that humanity was only 30 “minutes away from the end of the world.” The scientists behind the clock cited the “rise in strident nationalism worldwide,” “a darkening global security landscape” and “a growing disregard for scientific expertise.”

And, like those involved in the meeting, other prominent scientists have warned about the possible dangers of artificial intelligence. Musk himself predicted that humans will “meld their brains” with digital intelligence. Renowned theoretical physicist Stephen Hawking pointed to the risks of powerful autonomy and said that artificial intelligence could be “either the best or the worst thing ever to happen to humanity.”