first game loop implementation