added main game logic class and a state machine