added main loop of game