refactored game loop, worked on cube project