use of a stack system for the game states