   }
 }
 
-// Get the range in cm. Need to enable sensor first then wait briefly for it to power up
-// Also request temperture sensor, if previously detected, to take a reading.
-// Disable sensor after use.
-// Returns compensated, uncompensated and temperature values as reference params
-// boolean true returned form function for valid reading. false for <23cm or out of range
-// Calling function can still do checks to determine whether to use reading or not.
+// Start of Ultrasonic sensor code
 boolean getRange( int *outRawDistance, int *outDistance, float *outTemperature ) {
+
+  // Get the range in cm. Need to enable sensor first then wait briefly for it to power up
+  // Also request temperture sensor, if previously detected, to take a reading.
+  // Disable sensor after use.
+  // Returns compensated, uncompensated and temperature values as reference params
+  // boolean true returned form function for valid reading. false for <23cm or out of range
+  // Calling function can still do checks to determine whether to use reading or not.
+
   int16_t pulse;  // number of pulses from sensor
   int i=0;
   // These values are for calculating a mathematical median for a number of samples as

// Used in START msg to indicate firmware version, 314 = 3.1.4
#define VERSION_ID 314

// Hardware pin defines
// Enable SRF
#define SRF_RADIO_ENABLE 8
// Enable the sensor, controlled by FET

  if (!sendCommand("ATDN")) return 4;
  return 5; // success
}
// end of SRF sleep code

// Start of SRF command functions
uint8_t enterCommandMode()
{
  delay(1200);
