working game states and loops