fixed game loop and cleaned up some of the code