 
   // 11. Use average temperature to calculate actual distance.
   // ---------------------------------------------------------
-  double adjustedDistance = ( ( 331.1 + .6 * avgTemperature ) / 344.5 ) * avgDistance;
+  double adjustedDistance = SENSOR_TO_RIVER_BED - ( ( 331.1 + .6 * avgTemperature ) / 344.5 ) * avgDistance;
 
   int roundedDistance = round(adjustedDistance);
   int roundedTemperature = round(avgTemperature);

      textMessage += String(DATA_DELIM) + String(minutesElapsed) + " " + String(sensorReadings[i].distance) + " " + String(sensorReadings[i].temperature);
    }


    // GSM baud rate. Start communication link with GSM shield.
    Serial.begin(19200);


// Settings
// -------------------------------
#define SENSOR_TO_RIVER_BED        2000
#define SENSOR_TYPE                "d"
#define SEND_DATA_AFTER_X_READINGS 10
#define SLEEP_CYCLES               4
#define NUM_THERM_READINGS         5
#define THERM_READING_DELAY        20
