fixed some imports and created a global the_app variable for PythonAnywhere support