cleaned up code in app.py