coded rough main game loop