Now it uses a class instead of a global variable to control the movement of the robot