implemented python loggging and some redux: broke out some procedural stuff into methods