Imagine walking to school and constantly checking over your shoulder. This is the reality of the students who attend the magnet high school Academy of Palumbo in Philadelphia. Thanks to mass school closings and big budget cuts by superintendent William R. Hite Jr., walks to school have become longer and more dangerous for some students. According to the New York Times, 24 schools were closed and almost 4,000 public school employees were let go just last year, forcing more kids into less public schools.

Muggings and attacks are frequent in this area, especially for kids on their way to school. As a high school algebra teacher, Susan Lee, puts it, “It’s easier to grab them on their way here.”

But once Lee heard about the Samsung Solve for Tomorrow contest, a program that urges schools to raise interest in science, technology, engineering and math, she knew that her students themselves held the power to make their walks to school safer.

MORE: In New Mexico, High Schools that Inspire Would-Be Dropouts

Teaming up with her to work on this project was physics teacher Klint Kanopka and a team of 15 students. The group worked together after school for several months investigating the safest routes to school, interviewing and charting their peers’  data to create an algorithm that could be used in an app for students get to school safely.

The app gives scores, 1-5,  to different streets depending on recent crime data within 10 blocks of the school. The lower scoring a street is, the safer it is. If a shooting occurs on a certain street, that street will immediately jump up to a 5, meaning the students should avoid that street if possible.

The students’ project landed them a spot as one of five winners of the Samsung contest beating more than 2,300 other schools. According to the Philadelphia Inquirer, the winnings included $140,000 in new technology from Samsung and a free trip to Washington for the students and teachers.

As for the future of the app, Lee hopes it can be adapted and used anywhere across America. In the meantime, Kanopka is talking with University of Pennsylvania masters students specializing in urban planning and engineering about creating a program between the university and the Palumbo students this summer to help the students to continue refining and growing the safety benefits on their app.