Added state logic for game logic