There’s no fooling your smartphone these days. Not only will it tell you when you’ve spent too much time browsing social media or not walked enough in a day, it also knows when you’ve had one too many, according to a study in the Journal of Studies on Alcohol and Drugs.

The study, which was released on Tuesday, says phones can detect changes in walking that can indicate when someone is drunk. Lead researcher, Brian Suffoletto, M.D. with Stanford University School of Medicine’s Department of Emergency Medicine, hopes the study can help with responsible drinking and prevent drinking and driving.

“We have powerful sensors we carry around with us wherever we go,” Suffoletto says. “We need to learn how to use them to best serve public health.”

The study monitored 22 adults between the ages of 21 and 43. Each participant was given a vodka cocktail strong enough to produce a breath alcohol concentration (BAC) of 0.2 percent and had a smartphone strapped to their lower back. They then performed a walking test every hour for seven hours where the phones were able to measure the speed and movement of each step.

“About 90 percent of the time, the researchers were able to use changes in gait to identify when participants’ breath alcohol concentration exceeded 0.08 percent, the legal limit for driving,” according to the research.

As of now, the small study is being used as a “proof of concept” that Suffoletto hopes will lead to further research in the field.

“In five years, I would like to imagine a world in which if people go out with friends and drink at risky levels, they get an alert at the first sign of impairment and are sent strategies to help them stop drinking and protect them from high-risk events like driving, interpersonal violence, and unprotected sexual encounters,” says Suffoletto,

In the brave new world of mobile technology, this is surely something we can all get behind.