On Tuesday, something happened to the diving pool at the Rio Olympics. It turned green. Not just a little green. No. This was full-on lime Jell-O green, close to the color swatch movie set designers turn to when they want to make something look radioactive.

As of Friday, the pool is closed — and as a correspondent for the Today Show noted, the issue isn't limited to the water:

The Olympic diving pool has been closed again because of water quality issues...a German diver says "the whole building smells like a fart" — Tom Steinfort (@tomsteinfort) August 12, 2016

At first, Rio Olympics attributed the green color to "a proliferation of algae." Mario Andrada, a Rio spokesperson, told the Associated Press, "We did all the chemical tests."

And it appears the green discoloration is affecting another pool (used by water polo players and synchronized swimmers) at the outdoor aquatic center.

What happened? The Los Angeles Times talked to a spokesperson at the International Swimming Federation, or FINA, swimming's international governing body. According to FINA, the green color is not due to an algal bloom but to a problem with the pools' pH after the aquatic center ran out of the chemicals to fix it. Here's FINA's statement.

FINA can confirm that the reason for the unusual water color observed during the Rio diving competitions is that the water tanks ran out of some of the chemicals used in the water treatment process. As a result, the pH level of the water was outside the usual range, causing the discoloration. The FINA Sport Medicine Committee conducted tests on the water quality and concluded that there was no risk to the health and safety of the athletes, and no reason for the competition to be affected.

Did you catch that? Apparently, not enough pool chemicals were stocked for the Olympics.

Andrada told the New York Times that the pools' pH was thrown off by the large numbers of people using the pools. "We probably failed to note that with more athletes, the water could be affected," Andrada told the paper. "The people in charge of the pool should have done more intensive tests."

One other question: How does a change in pH change the color of the water?

I talked to Nate Hernandez, director of aquatic solutions at VivoAquatics, a company that builds and maintains pools in resorts and public facilities across the country.

He suggested a couple of ways.

One: A low or high pH can bring out minerals. "Calcium would show itself as cloudy water, copper would show up as a blue-green," he says.

Two: A too-high pH would render the chlorine ineffective, which could then allow for the proliferation of algae. (Hernandez says it's doubtful, though, that the green color is mainly from algae. It typically doesn't bloom that fast in such large pools.)

Hernandez is also a bit baffled as to how this could have happened. The Olympic officials ought to have known how many athletes would use the pools. And these pool control systems are largely automated. "Multiple things would have had to break down for this to happen," he says. "There's a lot of chatter going on in the aquatic industry about this."

I asked Hernandez if he'd be embarrassed if this were one of his pools.

"I'd be fired," he replied.

As Vox's Libby Nelson explained, it was the water quality in Rio's waterways that had people worried before the games began:

The pollution in Rio's waterways is serious: The locations for the rowing and sailing races are ridden with viruses that could sicken athletes if they inadvertently end up swallowing water, according to an investigation from the Associated Press. Five times in the past 13 months, Copacabana Beach, where the marathon swimming and triathlon will take place, had so much rotavirus in the water that if it were located in California, it would have had to post water quality warnings.

No one thought the swimming and diving pools would pose a problem. And perhaps it’s not a big deal, considering the officials say it’s safe. But the bigger question is: If it’s not resolved soon, would athletes be willing to compete in it?

Watch: Simone Biles is the gymnastics gold standard