modified flask-tutorial