Java code for the robot