tidied up the app.py file