It’s not often that the academic world gets together to celebrate a toilet. Today, however, it’s fair to say there will be a few professors and students willing to kiss the porcelain god. Last summer, the Bill & Melinda Gates Foundation made headlines when it challenged eight universities to “reinvent the toilet.” The goal was to create a toilet that harvested waste for energy instead of flushing it down the drain. With $3 million in funding up for grabs, the universities didn’t take the challenge lightly.

Yesterday, after a year of testing out different waste-to-energy concepts, the Gates Foundation made its decision. California Institute of Technology in the United States received the $100,000 first prize for designing a solar-powered toilet that generates hydrogen and electricity, but several other schools delivered prize-worthy “thrones” as well.

Image via Bill & Melinda Gates Foundation

The challenge issued to Caltech and the other universities was simple, yet seemingly impossible: create a toilet that can capture and process human waste without piped water, sewer or electrical connections, and transform human waste into useful resources, such as energy and water, at an affordable price.

After use, Caltech’s winning toilet flushes down to a holding tank under the floor, where the solid material sinks to the bottom, reports The Seattle Times. When the liquid reaches a certain level, it flows through a tube into a “sun-powered electrochemical reactor.” The reaction oxidizes the chloride in the urine, killing microorganisms in it. The resulting hydrogen is siphoned off, free to be used by the toilet’s owners as a fuel. The treated water is filtered and reused the next time someone sits on the toilet. The whole thing is powered with solar energy.

Loughborough University in the United Kingdom won the $60,000 second place prize for a toilet that produces biological charcoal, minerals, and clean water. University of Toronto in Canada won the third place prize of $40,000 for a toilet that sanitizes feces and urine and recovers resources and clean water. Special recognition and $40,000 went to Eawag (Swiss Federal Institute of Aquatic Science and Technology) and EOOS for their outstanding design of a toilet user interface.

“Imagine what’s possible if we continue to collaborate, stimulate new investment in this sector, and apply our ingenuity in the years ahead,” said Gates. “Many of these innovations will not only revolutionize sanitation in the developing world, but also help transform our dependence on traditional flush toilets in wealthy nations.”