main structure of game