 volatile unsigned long timeCenter;
 
 volatile unsigned long timeStart;
-// volatile unsigned long timeLeftStart;       //currently not being used
-// volatile unsigned long timeRightStart;      //currently not being used
-// volatile unsigned long timeCenterStart;     //currently not being used
-
 volatile bool timeStartSet;
-// volatile bool timeLeftStartSet;             //currently not being used
-// volatile bool timeRightStartSet;            //currently not being used
-// volatile bool timeCenterStartSet;           //currently not being used
 
 //For SPI communications
 volatile unsigned long timeWriteStart;
 volatile byte valueIn;
 volatile bool processIt;
 
-int range[RANGE_DATA_SIZE]{};
+int range[RANGE_DATA_SIZE][SAMPLE_DATA_SIZE]{};
 int analogRange[RANGE_DATA_SIZE]{};
 
 int roundCount, timeoutStart, timeSinceLastRound;
-byte boardCount; //just the front board
+byte boardCount, sampleIndex;
 
 volatile int isr1Count, isr2Count, isr3Count;
 
-const byte SCALE_FACTOR = 58;   //to calculate the distance, use the scale factor of 58us per cm
-const int BAUD_RATE = 115200;
 
 // -------------------------------------------------------------------------------------------------
 void setup()
 {
-    //DEBUG LED test
-    pinMode(DEBUG_PIN, OUTPUT);
-
     if (DEBUG_MODE)
     {
+        //DEBUG LED test
+        pinMode(DEBUG_PIN, OUTPUT);
+
         //Baud rate configured for 115200
         //It communicates on digital pins 0 (RX) and 1 (TX) as well as with the computer via USB
         Serial.begin(BAUD_RATE);
-
         digitalWrite(DEBUG_PIN, HIGH);
     }
     else

// #################################################################################################

#define DEBUG_MODE       true   //When DEBUG_MODE is true, send data over Serial, false send data over SPI
#define VERBOSE_DEBUG   false   //When sedning over Serial, true gives verbose output
// -------------------------------------------------------------------------------------------------

//Pin configuration for the Arduino Micro (atmega32u4)
//If using I2C to communicate with rear board, its SDA will need to share pin 2 with PW_OR2
#define PW_OR3       7     //Pulse on 9, 10 or 11 ====>> (actually pulse 1, 2, or 3 - Tai B.)
#define PW_OR1       3     //Pulse on 6 or 12
#define PW_OR2       2     //Pulse on 1, 2, or 3; or I2C. (actually pulse on 9, 10, or 11 - Tai B.)

#define S_DEC1       5     //Low order bit for selecting the round     //S-DECx pins good - Tai B.
#define S_DEC2       6     //Hi bit of round select

        processIt = false;  //False until we have a request to process
    }  

    timeLeft = timeRight = timeCenter = timeStart = 0;
    roundCount = timeoutStart = timeSinceLastRound = 0;
    isr1Count = isr2Count = isr3Count = 0;
    timeStartSet = false;
 
    pinMode(S_DEC1, OUTPUT);        //Pin 5 (PWM)       --> SD1
