The Great Barrier Reef fared better during an oceanic heat wave last year than during sizzling weather a year earlier that caused hundreds of miles of corals to bleach, according to a study

The report in the journal Nature Climate Change analyzed how corals along the Great Barrier fared in back-to-back mass bleaching events. The reef ― a UNESCO World Heritage Site and the largest living structure on the planet ― was cooked by overheated seawater in 2016 and again in 2017, with images of sickly white coral horrifying people around the globe.

During the first event, which scientists likened to an underwater apocalypse, almost 30 percent of the reef died.

But the second event last year, which saw seas even hotter than 2016 in many places, didn’t harm the reef as badly as scientists expected. They speculated that the structure may be going through a forced evolution that has helped toughen it, at least in part.

“The good news is the Barrier Reef glass is still half-full,” said Terry Hughes, a lead author of the study and the director of the ARC Centre of Excellence for Coral Reef Studies. “Whether we’ll still have reefs in 50 years time … there’s a glimmer of hope that we will.”