January 24, 2016 12:56 PM EST

The town of Flint is still reeling from the contamination of its water supply, which exposed thousands of residents to lead-laced water, put Michigan Gov. Rick Snyder in the political hot seat and prompted an emergency declaration from President Obama.

So how did a town of 100,000 lose access to something as basic as clean drinking water? First you have to understand how Flint got its water before the crisis.

Flint’s water when it was safe

For almost half-a-century, Flint purchased water from Detroit, which properly treated the water with orthophosphate, a chemical that essentially coated the pipes as water flowed through them, preventing lead from leaching into the water supply. Here’s what the process looked like then.

TIME animation by Lon Tweeten

A change in the water supply

Flint switched from Detroit’s water supply to the Flint River in 2014, in part to save money. But the city did not use corrosion control to prevent lead from entering the water. The river itself was also found to contain eight times more chloride than Detroit’s water, a chemical that is highly corrosive to metals. Most residents in Flint have decades-old lead service lines that connect their homes to the city’s main water pipes. When water from the river flowed through those pipes, it ate away at their insides, allowing lead to enter the supply. Here’s what it looked like after the switch—with red used to connote lead, a colorless substance.

TIME animation by Lon Tweeten

Don’t drink the water

Once Flint switched its water supply, most Flint residents knew it immediately. Residents described the water coming from their taps often as a brownish-yellow and said it both smelled and tasted odd.

It was later discovered that the water was carrying significant amounts of lead, which can prove especially damaging to children. In October 2015, the city switched back to the Detroit water supply, but Flint’s water is still deemed unsafe to drink.

Below, you can see what some of the contaminated water actually looked like.

This image provided by FlintWaterStudy.org shows water samples from a Flint, Mich. home. The bottles were collected, from left, on Jan. 15 (2), Jan. 16 and Jan. 21, 2015.
More Must-Read Stories From TIME

Write to Lon Tweeten at lon.tweeten@time.com.

Read More From TIME
You May Also Like