R2 robot code