 
 //-------------- Main supporting functions ------------
 
-char* commandListen(char incoming){  // returns if a command has been called
+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;}


// direction constants
#define BACK_LEFT  '1'
#define BACK		   '2'
#define BACK_RIGHT '3'
#define SPIN_LEFT	 '4'
#define STOP		   '5'
#define SPIN_RIGHT '6'
#define FWD_LEFT	 '7'
#define FWD		     '8'
#define FWD_RIGHT	 '9'
// command types
#define MOVEMENT   'M'
#define SPEED      'S'

  int finalSpeedLeft = 0;
  int finalSpeedRight = 0;

	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;}
	}
  // !! no ramping assumes your motor controllor does it !!
  leftWheel.writeMicroseconds(map(finalSpeedLeft,-255,255,1000,2000));
