Re-arranging robot.py so it can be used easier externally