fixed bugs and basic game state tracking