complete main framework of the game.
backup for homework.