added a game loop