even simpler.  consolidated the logic in app.py to make thing easier