Politics might get dirty in D.C, but the nation’s capitol is making sure that even the dirtiest solid waste is getting cleaned up into green, renewable energy.

This week, utility company D.C. Water unveiled a brand new bioenergy facility that turns D.C. residents’ wastewater (from sinks, showers, and yes, toilets) into clean energy.

Here’s how it works. Wastewater, including solid sewage, travels to the plant, where the liquid is separated out and sent to a traditional wastewater treatment plant. The solids that are left over are heated, sterilized, and mixed into an easily digestible mass. That mixture is then sent into a digester, where a certain mix of microbes chows down on the waste, producing methane as they digest their meal. That methane is then burned and used to generate about 10 megawatts of electricity.

The energy is used to power the pipes and pumps of D.C. Water, saving them an estimated $10 million a year in energy bills. Further, the remaining sterilized solids are free of harmful viruses and bacteria, but are still full of nutrients, and the city plans to sell the remaining solids as Class A biosolids, a compost mixture that can be used to grow plants.

The Washington Post has a thorough infographic if you want more of the dirty details of the process itself. The plant is billed as the largest of its kind in the world, and city leaders certainly hope that it will be a model for other cities around the world that are looking to not waste their waste.