   // Turning completed
 
   // minus sign indicating turning right
-  errorCumulator->record_turning_error_compass(-adjusted_angle); 
+  errorCumulator->record_turning_error_compass(isRightForward*adjusted_angle); 
   // not affect the polling
   Serial.print("Turning right: "); Serial.print(avgTicksForAngleOrDist); Serial.print(" / "); Serial.println(noOfTicksForAngle);
   

  
  motorShield.setBrakes(Config::MAX_SPEED, Config::MAX_SPEED);
  delay(40);
  //halt();
}
///////////////////////////////////////////////////////////////////////////////////////////////////
// angle in this function is abs


  
  while (avgTicksForAngleOrDist < noOfTicksForDist) {
    leftTicksForAngleOrDist = abs(PololuWheelEncoders::getCountsM1() - leftCount0);
    rightTicksForAngleOrDist = abs(PololuWheelEncoders::getCountsM2() - rightCount0);

    avgTicksForAngleOrDist = (leftTicksForAngleOrDist + rightTicksForAngleOrDist) / 2.0; // reaching the target

