Added all logic for game.