added main game loop