It was the contractor’s fault.

After offering little clarity about why the water in two Olympic competition pools mysteriously turned green this week, Rio 2016 officials said Saturday it was because a a contractor poured hydrogen peroxide into the diving well and the large pool in the center last week. The chemical reacted with the chlorine and turned the water an emerald green and increasingly murky.

Officials initially blamed the color on sunlight and lack of wind in the open-air aquatic center, which is used for diving, synchronized swimming and water polo.

Hydrogen peroxide is a de-chlorinating agent, which means it undoes what chlorine is supposed to do — kill germs and keep water clear. That could explain the murkiness that resulted, and, as the days went by, only got worse.

Rio officials maintained that the water was not a health hazard to athletes, and training sessions and competitions continued in the green pools.

But on Saturday, the pools were drained so the increasingly swampy water could be replaced with fresh water in time for synchronized swimming, which requires competitors and judges to have good visibility underwater. The process will take six hours, according to the AP, and another four hours to fill the pool, which will hopefully be ready for athletes by Sunday morning.

“Of course it is an embarrassment because we are hosting the Olympic Games,” Rio 2016 spokesman Mario Andrada told the AP. “It should be light blue, transparent. We could have done better in fixing it quickly. We learned a painful lesson the hard way.”

That seems to be the theme for the operations snafus at these Games. On Friday, three swimmers competing at the Olympic Aquatics Center were driven to the Olympic Stadium instead, 40 minutes away, forcing officials to change the order of events to give the athletes time to return to the pool and warm up.

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.