It was a controversial move when Madison, Wis., decided to replace all its lead pipes in 2001. But that decision put the city ahead of the curve — allowing it to avoid the lead water contamination that is plaguing cities like Flint, Mich., now.

Madison started using copper instead of lead water pipes in the late 1920s. The bulk of the lead lines were located in the older part of the city, which is downtown near Wisconsin's state Capitol.

Sue Bauman, the city's mayor from 1997 to 2003, lives there now.

"I remember one day, one of my mayoral aides came in and said he had met with the water utility and there was this issue about these lead pipes, and I'm like, 'What?' " Bauman says.

EPA released its lead and copper rule in 1991, setting limits on the concentration of lead and copper in drinking water. A year after that, the city's water utility learned that 10 percent of the samples from the city's water showed higher levels of lead than the EPA allowed. That was also the case five years later.

Following the rule's adoption, chemical engineer Abigail Cantor started testing the water after it was treated with phosphate that authorities recommended they use to prevent lead from leaching into water. But what she found was shocking.

"[I] found that the lead increased four times over the untreated water using the highest recommended phosphate product," Cantor says.

She says other additives created even more problems, but city officials worried that the chemicals added to prevent corrosion could cause algae and weeds in the city lakes because of excess nutrients and water runoff.

"So I went to the management at the water utility and said, 'You can't use these recommended chemicals, and there's no other. You just have to get rid of the lead pipes,' " she says.

Eliminating Lead Pipes Not An Easy Process

Joe Grande, the city utility's water quality manager, says there was skepticism and concerns about cost.

"There was tremendous pushback from homeowners," Grande says.

Legally, the water utility only had to pay for the portion of the lead service lines that ran from the city's water main up to a home's or business's property line. But Grande says Madison also wanted those residents to replace the other half of the lead line.

"Studies have shown that if you only do a partial replacement, [where] the utility comes and replaces their portion of the service, that there is no improvement in lead levels in the water and it actually could be worse in the short term," he says.

Getting approval from regulators and lawmakers took years and the battle over costs was extensive. For nearly 6,000 property owners, it meant about a $1,300 plumbing bill. Madison reimbursed half of that cost. It took the city 11 years and $15.5 million in all to remove 8,000 lead water pipes.

Grande says samples of Madison water still show that lead is present, but the levels are well below EPA limits.

"That's coming from solder, that's coming from brass fittings [and] also coming from fixtures as well," he says.

Nevertheless, Bauman calls the Madison lead pipe removal program a success and says the city made the right decision.

"It was a forever solution, and if you looked at the cost of adding chemicals to the water system, to the water supply forever compared with the one-time cost of replacing over time, you were better off," Bauman says.

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