Bangladesh has done a great job of getting more toilets to more people. Now it needs to figure out how to empty them.

According to the World Bank, rates of "open defecation" (development jargon for pooing in public) in Bangladesh have dropped from 34 percent in 1990 to just 1 percent nationwide in 2015. Other surveys put the rates of open defecation at a slightly higher rate than 1 percent but still note that there's been a significant decline in the amount of human waste on the streets over the last couple of decades. The reason for this is a boom in pit latrines, a.k.a outhouses, privies, crappers.

This recent "expansion of access to sanitation" (to stick with the development jargon) has made neighborhoods look and smell better all across the country. But particularly in rural areas, many of the new sanitation facilities are no more than a bare-bones shack on top of a hole in the ground.

And when those pits get full, emptying them can be an unpleasant, arduous ... and a financial burden for poor families. It currently costs roughly $13 to have a pit latrine emptied — roughly 14 percent of an average family's monthly income in rural Bangladesh. Rizwan Ahmed with the NGO Forum for Public Health in Dhaka, Bangladesh, says pit latrine maintenance can also be a community health problem.

"The sludge is taken out from the pit latrines and transported to nearby [irrigation] canals," Ahmed says. "It's discharged into the canals, nearby rivers, nearby small ponds, polluting the surface water. Also sometimes, it's buried under the soil." And then local ground water can be contaminated.

Ahmed says part of the problem is that there's no established way to empty pit latrines. Some families do it themselves and bury the waste elsewhere on their property. Some people hire young men to clear out the sludge and haul it away. But Ahmed says that even when latrine owners pay to have the sewage removed, it likely ends up dumped in a waterway.

Ahmed, along with a group of academics and clean water advocates, have just completed a pilot program in a rural part of Bangladesh to try to solve the pit latrine sludge conundrum.

The program uses pumps to suck the sludge out of the pits as opposed to the old shovel and bucket method. It sets up a monthly payment system so that families aren't hit with a big expense every 3 to 4 years when their latrine is overflowing. And it establishes a composting system to turn the sludge in to fertilizer for flowers, rubber trees and other non-edible plants.

"This is a research project," Ahmed says. "We are trying to see the feasibility of doing this."

They've determined that it is feasible. They've calculated that a system including the cost of labor, pumps, trucks and a composting facility would cost each privy owner roughly .31 U.S. cents a month. This is opposed to the current average cost of $13 every 3 years or so to hire informal laborers to clear out the pit and haul away the sewage.

The research has just been published in the journal PLOS ONE.

"In recent years, Bangladesh has made rapid progress in improving sanitation in rural areas and around 40 million new pit latrines have been built," the study says. "However, this rapid increase in use of household latrines has not been accompanied by a growth in appropriate management of fecal sludge."

Rolf Halden, the curator of the National Sewage and Sludge Repository at Arizona State University, says managing pit latrine waste is a problem all over the developing world but an even bigger challenge in Bangladesh. He is not part of the pit latrine project.

"Bangladesh is peculiar in the fact that it has a very shallow ground water and sees lots of raining. It's also an area that's subject to flooding," he says. "That really makes the problem [in Bangladesh] much more prominent than in other locations."

The problem of sewage disposal is further complicated because Bangladesh is extremely poor and incredibly crowded. Only the capital, Dhaka, has a sewer system, and even there those pipes only serve about 18 percent of the city, according to the World Bank. So most of the nation's 160 million people relieve themselves in pit latrines.

Halden, who is also a professor of environmental engineering and the director of the Biodesign Center for Environmental Security, says all that sludge poses a risk to public health both while it's sitting in the latrine and when the latrines are emptied. "[The waste] contains viable organisms — viruses, bacteria — and they cause diarrheal disease," he says.

And pit latrines aren't just a Bangladesh issue.

"We know that 1 in 4 people on this earth use pit latrines," Halden says. "So it's a significant amount of sludge that's being produced by these systems."

Copyright 2017 NPR. To see more, visit http://www.npr.org/.