app.py adaptation