Working robot code