improved app.py a bit more