added game state logic