Added a main game loop