What goes in our bodies must eventually come out. And when it does, it can be analyzed. Scientists already track our bodily excretions to figure out what kind of drugs we’re using, but it’s not always easy to tell when we used them. If someone at a music festival leaves their toxins in a public toilet, for example, that person will probably be miles away before researchers get to take a closer look.

That’s why the scientists behind a study published Wednesday in the journal Environmental Science & Technology decided to combine toilet data with cell phone use statistics. Combined with the information that comes from our phones, the data from wastewater become a lot more useful to scientists, the Norwegian Institute for Water Research scientists write.

This may sound bizarre, but there’s actually a pretty good reason for it. Even if researchers find drugs in the wastewater for a city or neighborhood, they might not be able to discern much about what that means. But if cell phone towers show how many people were living and working in that area during the given timeframe, then the results become much clearer.

Norwegian scientists looked for drugs in the water collected from all the regions marked in red. Thomas et al.

In this study, cell phone data (without people’s personal information attached) served as an estimate of the number of people who were in a sewage catchment area in Oslo, Norway throughout June and July 2016. During these popular vacation months, lots of people came and went, with numbers fluctuating widely (as shown on the graph below). Despite these fluctuations, the levels of prescription drugs in wastewater didn’t change a whole lot from day to day and week to week.

Using phone data allowed the scientists to track small increases in drug levels in wastewater.

The levels of cocaine and MDMA, however, did change. On weekends, the researchers found 2.4 times the weekday levels of MDMA and 1.6 times the weekday levels of cocaine.

These findings were proof that, by combining cell phone data with wastewater tests, researchers can gain insight into how many people contribute to different levels of drugs in wastewater, which can help future public health researchers assess how communities are using drugs.

Right now, researchers are largely dependent on data from surveys of drug users, which isn’t always reliable. “I understand how mobile phone data could help validate such findings,” Joseph Palamar, a public health researcher at New York University who wasn’t involved in this research, tells Inverse.

Palamar conducts research on ecstasy at dance parties by surveying attendees and taking samples of their hair to find out what they’re really taking. But he recognizes the fact that broader approaches can enhance scientific understanding of drug usage patterns.

“Wastewater analysis is becoming more common for testing drug use in certain populations. I even saw a paper last year describing increases in ketamine and other drugs in a local water supply during a dance festival.”