 
   if (LeftAmps>Leftmaxamps)                                   // is motor current draw exceeding safe limit
   {
-    analogWrite (LmotorA,0);                                  // turn off motors
-    analogWrite (LmotorB,0);                                  // turn off motors
-    leftoverload=millis();                                    // record time of overload
+    // Turn off motors
+    analogWrite (LmotorA,0);
+    analogWrite (LmotorB,0);
+
+    // Record time of overload
+    leftoverload=millis();
   }
 
   if (RightAmps>Rightmaxamps)                                 // is motor current draw exceeding safe limit
   {
-    analogWrite (RmotorA,0);                                  // turn off motors
-    analogWrite (RmotorB,0);                                  // turn off motors
-    rightoverload=millis();                                   // record time of overload
+    // Turn off motors
+    analogWrite (RmotorA,0);
+    analogWrite (RmotorB,0);
+
+    // Record time of overload
+    rightoverload=millis();
   }
 
   if ((Volts<lowvolt) && (Charged==1))                        // check condition of the battery
   {                                                           // change battery status from charged to flat
 
-    //---------------------------------------------------------- FLAT BATTERY speed controller shuts down until battery is recharged ----
-    //---------------------------------------------------------- This is a safety feature to prevent malfunction at low voltages!! ------
-
-    Charged=0;                                                // battery is flat
-    highVolts=Volts;                                          // record the voltage
+    //
+    // FLAT BATTERY speed controller shuts down until battery is recharged
+    //
+    //
+    // This is a safety feature to prevent malfunction at low voltages!!
+    //
+
+    // Battery is flat
+    Charged=0;
+
+    // Record the voltage
+    highVolts=Volts;
     startVolts=Volts;
-    chargeTimer=millis();                                     // record the time
-
-    chargeStart=millis();                                     // record start time
+
+    // Record the time
+    chargeTimer=millis();
+
+    // Record start time
+    chargeStart=millis();
 
     Serial.print("Battery dead at ");
     Serial.print(Volts, DEC);
     Serial.println(", enabling charger...");
 
-    digitalWrite(Charger,0);                                  // enable current regulator to charge battery
-  }
-
-  //------------------------------------------------------------ CHARGE BATTERY -------------------------------------------------------
+    // Enable current regulator to charge battery
+    digitalWrite(Charger,0);
+  }
+
+  //
+  // CHARGE BATTERY
+  //
 
   if ((Charged==0) && (Volts-startVolts>67))                  // if battery is flat and charger has been connected (voltage has increased by at least 1V)
   {
     if (Volts>highVolts)                                      // has battery voltage increased?
     {
-      highVolts=Volts;                                        // record the highest voltage. Used to detect peak charging.
-      chargeTimer=millis();                                   // when voltage increases record the time
-    }
-    
+      // record the highest voltage. Used to detect peak charging.
+      highVolts=Volts;
+
+      // when voltage increases record the time
+      chargeTimer=millis();
+    }
+
     if ((millis()-reportTimer) > reportInterval) {
       logBatteryVoltage();
       reportTimer=millis();

  Serial.print(units);
  Serial.println(" units)");
}

         Serial.println(RightPWM);

         break;

       // invalid command
       default:                                                
         Serial.flush();
    }
  }
}

//
// Read serial port until data has been received
//
void Serialread()
{
  do
  {
    data=Serial.read();
  } while (data<0);
}


void I2Cmode()
{
//
// Your code goes here
//
}


