Refactoring moveForward and moveBackward

yolo