Scientists in Florida may have just saved the the third largest coral reef on the planet.

Florida Aquarium Senior Coral Scientist Keri O’Neil, aka “The Coral Whisperer,” and her team of researchers today announced they’d successfully spawned Atlantic coral in a laboratory – the first time this has been accomplished. The implications for their work will almost certainly save “America’s Barrier Reef,” and will probably have a huge impact on efforts to resuscitate coral populations around the world.

Not bad for a group of people who’ve spent the last few years teaching sex ed.

Coral colonies throughout the world’s oceans are dying off due to a combination of disease, rising water temperatures due to climate change, and damage caused by ships. The general scientific consensus is that the only way we’re going to save them from extinction – including Australia’s Great Barrier Reef – is to significantly lower carbon emissions and encourage coral to procreate through sex.

But getting coral to bang in a laboratory is no easy feat. You can’t just toss a bunch of them in a fish tank and expect the greatest show on Earth to happen spontaneously. You have to put on some Barry White, dim the lights, and set the mood. No, literally: that’s what the scientists did.

Coral only reproduces sexually under very specific conditions. It has to be night, the temperature has to be right, and it doesn’t hurt to play a little Barry White. O’Neil – the aforementioned Coral Whisperer – told public media outlet WUSF:

We do actually play Barry White during the spawn time. But I think that actually gets the humans in the mood a little bit more while we’re staying up all night, waiting for these corals to spawn.

Like many animals, coral reproduces via egg and sperm. They can also reproduce asexually in the same manner a starfish does by breaking off a piece of itself and attaching somewhere else. But addition by subtraction can’t solve the devastating loss of coral fast enough to save much of the world’s coral from complete extinction within a matter of years.

Unfortunately, as is the case in many coral colonies, the devastation to America’s Barrier Reef has left the male and female populations too far apart for copulation in the wild. At this point, the species that make up the reef are considered endangered and it appears as though human intervention is necessary to prevent extinction.

In the breakthrough experiment that resulted in today’s confirmation of a successful laboratory mating, the team actually solved their problem with sleepy researchers too. Instead of staying up all night to observe the limited spawning, they flipped the coral‘s day/night cycle by changing the lighting conditions inside the laboratory so the researchers could watch it during their normal work day.

This wasn’t just a matter of dimming the lights or closing the curtains. Everything has to go just right for coral to mate; the lighting has to be exact, and the temperature has to be perfect. The species that O’Niel and her team were working with, pillar coral, typically mate during the summer months after a full moon. With this in mind, the team created a computer-controlled LED lighting system to ensure those conditions were met to a tee.

And then Mother Nature did what Mother Nature does.

Just a few square meters of coral can produce thousands upon thousands of eggs and sperm. The hope is that the team’s method can be used to set up relatively small populations of coral in artificial environments to spawn new coral annually that will then be seeded in the reef to replace its decimated pillar coral population.

Scientists had previously used a similar technique to reproduce Pacific coral in laboratories, but this was the first time anyone had successfully pulled it off with an Atlantic species. For more information about the Florida Aquarium’s “Project Coral” click here.

Read next: This Sony patent could mean the PlayStation 5 will actually be the PlayStation V