cleaned up and commented the app run section