#2: Change code to work with any type of application and fix formatting