   int finalSpeedLeft = 0;
   int finalSpeedRight = 0;
 
-	if (speed == 0 && direction) {
-		finalSpeedLeft = direction;
-		finalSpeedRight = -direction;
+	if(speed == 0 && direction) {
+    finalSpeedLeft = direction;
+    finalSpeedRight = -direction;
 	} else {
-		finalSpeedLeft = speed * ((-255 - direction) / -255.0);
-		finalSpeedRight = speed * ((255 - direction) / 255.0);
-
-		if (speed > 0 && finalSpeedLeft > speed){finalSpeedLeft = speed;}
-		if (speed > 0 && finalSpeedRight > speed){finalSpeedRight = speed;}
-		if (speed < 0 && finalSpeedLeft < speed){finalSpeedLeft = speed;}
-		if (speed < 0 && finalSpeedRight < speed){finalSpeedRight = speed;}
-
+    finalSpeedLeft = speed * ((-255 - direction) / -255.0);
+    finalSpeedRight = speed * ((255 - direction) / 255.0);
+
+    if (speed > 0 && finalSpeedLeft > speed){finalSpeedLeft = speed;}
+    if (speed > 0 && finalSpeedRight > speed){finalSpeedRight = speed;}
+    if (speed < 0 && finalSpeedLeft < speed){finalSpeedLeft = speed;}
+    if (speed < 0 && finalSpeedRight < speed){finalSpeedRight = speed;}
 	}
   // !! no ramping assumes your motor controllor does it !!
   leftWheel.writeMicroseconds(map(finalSpeedLeft,-255,255,1000,2000));

 * Compiled with Arduino IDE 1.6.5
 * The goal of this project is to provide remote control and some autonomous
 * program modes for a 2 wheeled robot driven by the 2x12 Sabertooth motor controller
 * !! no ramping assumes your motor controllor does it !!
 * This robot also has a IR long range distance sensor panned by a servo
 * in order to cover a range of posible obstacles
 * The readme will include details of remote control via serial port


//-------------- Main supporting functions ------------

char* commandListen(char incoming){  // returns if a command has been recieved
  static char packet[2] = { 0, 0 }; // store potential incoming command packet
  // reset if a full packet has been recieved
  if(packet[0] && packet[1]){packet[0] = 0; packet[1] = 0;}
