One of the many advantages of indoor plumbing is that once you flush the toilet, you don’t need to think about what you just did ever again. For those in urban areas, the contaminated water flows into sewer pipes, which carry fecal matter, urine and wastewater to a treatment plant, where the “biosolids” are separated out and sterilized and the water is filtered and returned to nature.

But we probably should give a little thought to what happens after you-know-what. Sewage treatment produces thousands of tons of waste product every day, which either end up in landfills, get dumped in the ocean or, in some cases, are made into fertilizer. Now, reports JoAnna Klein at The New York Times, researchers in Australia have discovered a use for your poo after you flush: baking the sand-like biosolids into clay bricks, bringing a literal sense to the phrase “to s—t a brick.”

Klein reports that currently, about 50-to-70 percent of the 7-to-8 million tons of dried, sterilized biosolids produced in the United States each year are converted into fertilizer, with similar numbers found throughout the world. But about a third of the solid waste still end up in landfills, where it slowly decomposes and releases greenhouse gases. At the same time massive amounts of clay—almost 4 billion cubic yards—are dug out of the ground annually to produce trillions of bricks.

Turning the biosolids into bricks solves both of those environmental problems. That’s why Abbas Mohajerani of RMIT University in Melbourne and his team began experimenting with different recipes for biosolid bricks. They tried various mixtures, making bricks with 10 to 25 percent biosolid content the examined the physical, chemical and thermal properties of the poop cubes, according to their study published in the journal buildings.

They found that bricks containing the biosolids met all safety standards, though they were a tad less sturdy. The biosolid bricks did have a couple of advantages as well. They are more porous, meaning they have more bubbles of gas trapped inside, making them lighter and more insulating, which could save on heating costs. It also took less energy to fire the bricks—close to a 50 percent reduction for bricks made with 25 percent biosolids, meaning adding the poop particles to the bricks could reduce energy costs in producing them.

Klein reports that making bricks with 15 percent biosolid content would be enough to eat up the entire world’s stockpile of biosolid waste.

“Using biosolids in bricks could be the solution to these big environmental challenges,” Mohajerani says in a press release. “It’s a practical and sustainable proposal for recycling the biosolids currently stockpiled or going to landfill around the globe.”

In a related study last year, the team found that incorporating the biosolids into bricks did improve their overall life cycle sustainability, though the process did need a little more water to produce them. Ideally, the bricks would be made at plants close to sewage treatment centers to reduce carbon emissions associated with trucking the biosolids to a factory.

This is not the only effort to make more sustainable bricks. In 2010, researchers experimented with adding wool fibers and a polymer found in seaweed to make reinforced bricks. And in 2016, Mohajerani published a paper showing that making bricks with one percent cigarette butt content made them cheaper to produce and more insulating as well, while also getting rid of the disgusting butts, which are one of the most polluting items in the ocean.