Testing to see if someone peed in the pool just got a little bit sweeter: Scientists in Canada have developed a new way to test for urine, and it involves measuring how sweet the water is.

That is, the researchers turned to an artificial sweetener called acesulfame potassium. Acesulfame potassium isn’t broken down in the body and is excreted in urine, according to the study. The compound persists in bodies of water and remains stable at various pH levels and temperatures.

The researchers hypothesized that it could be a good indicator of urine levels in pools.

Many compounds in urine can react with compounds in swimming pools, such as disinfectants, and form “disinfection byproducts.” Some studies suggest that these byproducts may be harmful to human health, though it’s unclear if coming into contact with them in a swimming pool is dangerous, the researchers wrote.

The potential that these compounds may have to be harmful inspired the researchers, led by Lindsay Blackstock, a doctoral student in analytical and environmental toxicology at the University of Alberta in Canada, to investigate a way to test for urine in the water. [Tips for Keeping Kids Safe in Swimming Pools]

Acesulfame potassium is found in many packaged foods, the researchers noted. In recent years, artificial sweeteners have been increasingly recognized as a source of environmental contamination.

On average, the concentration of acesulfame potassium in pee is 4,000 nanograms per milliliter, according to the study.

In the study, the researchers collected samples from a total of 22 swimming pools and eight hot tubs in two Canadian cities. In addition, they collected samples of the municipal tap water in each city, as this was the source used to fill the pools and hot tubs.

They found that the concentrations of acesulfame potassium in the pools and hot tubs ranged from 30 nanograms per liter up to 7,110 ng/L. This variation may be explained by a number of factors, including how the water was filtered in the pool, and the number of people swimming (and potentially peeing) in it, the researchers noted.

The concentration of the artificial sweetener found in the municipal tap water was much lower, however: It ranged from 6 ng/L to 15 ng/L, according to the study — meaning that the concentrations of acesulfame potassium in swimming pools and hot tubs was up to 571 times greater than what was found in the tap water.

In a separate experiment, the researchers took 15 samples from two swimming pools over a three-week period. One pool held 220,000 gallons of water (one-third the size of an Olympic pool) and one pool held half that, with 110,000 gallons of water.

Using the acesulfame potassium concentrations as a guide, they estimated that, on average, the smaller swimming pool contained about 30 liters (7.9 gallons) of pee, and the larger pool contained about 75 liters (19.8 gallons) of pee.