Even if you’re not the type of person who takes selfies on the regular, you can probably tell the difference between a good one and a bad one. And let’s face it: We all envy that one friend whose selfies are consistently on-point.

Luckily for those who can’t seem to master the art of the selfie, computer scientists at the University of Waterloo have created an app that can save your Instagram feed, one flattering selfie at a time.

The app uses an algorithm to give users directions on camera positioning, so that in the process of taking the photo they find out what makes a good selfie. “Unlike other apps that enhance a photo after you take it, this system gives direction, meaning the user is actually learning why his photo will be better,” said Dan Vogel, a professor of computer science at the university.

To create the algorithm, he and Qifan Li, a former master’s student, took hundreds of selfies—not of themselves, but of 3D digital models of people. They wrote code to control the different aspects of the “selfies,” including lighting direction, face size, and face position. With the help of an online crowdsourcing service, they had thousands of people vote on the best selfies to figure out which aspects all of the best photos had in common.

Once they developed the algorithm, real people got to take selfies using the algorithm-based app, as well as with their standard camera app. Some more crowdsourcing found that the selfies taken with the souped-up selfie app were 26% better than those taken with a regular camera app.

Unfortunately, you won’t find it in the App Store just yet—Vogel and Li recently presented it at the 2017 ACM Conference on Designing Interactive Systems in Edinburgh, Scotland. But if you’re interested, there’s a Youtube video explaining the ins and outs of the app.