added validations on if robot can move forward and refactored verbose code