The Madison Metropolitan Sewerage District spent roughly $40 million to upgrade the Nine Springs wastewater treatment plant in Madison County, Wisconsin. The system captures phosphorous in dirty sewerage water and creates fertilizer pellets from the waste.

The district partnered with British Columbia-based Ostara to build the completely new nutrient-recovery, or phosphorus-harvesting system. “It’s a very efficient and an environmentally friendly way to fertilize,” Ostara president Phillip Abrary said. “Not only are we recovering the phosphorous, but we are redeploying it in a better way than it started out.”

It works by funneling sewerage water into cone-shaped vessels. There, the waste reacts with other chemicals and is pumped upward. The vessels then converts the dirty, phosphorus-rich water and waste into a fertilizer with less phosphorus, which can be used on land.