code for the app