created the main game loop