Most of us don’t give a second thought to what happens after we flush, but our daily leftovers have to end up somewhere. In New York City, where residents create approximately 1200 tons of sewage every day, this is not an issue to poo-poo—and for 20 years, the answer was a train loaded with our refuse that left the city and traveled 1600 miles out west, where farmers made the best of a stinky situation. New York City's Poop Train, and the controversy surrounding it, were featured in a 2013 episode of the podcast RadioLab.

Thirty years ago, the treated remnants of a city’s sewage—known as “biosolids” to those in the industry—usually went into the ocean. But in 1988, the government realized this wasn’t the best idea and gave municipalities three years to figure out where else their sludge could go. In addition to finding a new place to put it, the EPA ruled a portion of the biosolids had to be used in a way that would benefit the environment.

New York City, which already had a population over 7 million, had been dumping its sewage 106 miles out in the ocean. (This was an improvement on the 12 miles out it was dumping sewage in 1987, but still not ideal.) A solution needed to be found, and fast.

So the city decided to turn the sludge into fertilizer. The EPA ruled that, after treatment, biosolids are perfectly safe to use on plants, and often, are better for the plants than chemical fertilizers. They are rich in nutrients that help plants grow, and the application of biosolids to the soil has been known to stimulate root growth and help the soil better retain water.

This wasn't a new idea—the city of Milwaukee had been selling their biosolids as a fertilizer called Milorganite since the 1920s—but there was something about putting big city sewage on their crops that made farmers pause.

Although they accepted sludge from other locations, states feared the material from New York City would be disease-ridden and toxic. Alabama outright rejected the biosolids, and in Oklahoma, even after farmers begged for the material, a plan to ship 1150 tons of biosolids to the state was defeated due to public outcry. “No part of Oklahoma will be sacred,” wrote Tim Cagg, the chairman of Concerned Citizens for a Clean Environment. “These profit seekers will not be around when we must clean up the damage in years to come.”

Eventually, some farmers in Colorado said they would try it. Just before before Earth Day 1992, 17 train cars filled with several thousand tons of big city biosolids left the station and headed to a new life on Lamar, Co. farms. “At first people wanted to flee the land when they found out New York’s sewage was on the way,” farmer Douglas Tallman said at the time. Tallman’s enthusiasm for the product got him nicknamed “Sludge Judge” in local politics.

Initially, only three or four farms volunteered to take the waste. But then the farmers started to notice some changes. One farmer’s wheat crop yield increased by a third after using biosolids. The sludge also appeared to keep away aphids, prairie dogs, and other pests. Soon, there was a waiting list for farmers who wanted to get their hands on New York biosolids.

New York kept producing, and the farmers kept buying. Trains were now running twice a month to Colorado. The longest train the state received was 153 cars of the stuff. At its peak, 10,000 acres a year were being covered with sludge from the big city, but the demand was so great, 50,000 to 75,000 acres could have been covered if there had been enough product.

The one problem, though, was the cost. Shipping waste on a rail line wasn’t cheap, and the city started looking for other options. Despite demand, in 2012, the train stopped running.

Today, New York City biosolids are treated in ways that cost about half as much and are either stored in a landfill or mixed with other substances to neutralize soil acidity. About 50 percent of all biosolids produced nationally are currently being recycled to land in all 50 states. Anyone who would like to use the product can apply through the EPA’s website. However, there are no plans for the New York City poop train to leave the station again.