Modify rename run into gameloop and move everything into main unit