The robot only moves forward instead of using the switches to detect obstacles, stop and use the irLoop to double check the obstacle. I have tested the switches (used in the void loop) and they work fine. It is when I add the irLoop functionality within the void loop() when the robot stops working as it's suppose to.