rewrote robot in python