Add utility function to update game state