working save game state and restore game state