second draft and added condition in run.py file so that app running function works with the interpreter and not as an imported module