 }
 
 void sendToKeen() {  
+
   String my_output = "{";
-  my_output += "\"AppId\":\"";
-  my_output += appId;
-  my_output += "\",\"HumidityPercent\":";
-  my_output += am.humidityAir;
-  my_output += ",\"AirTemperatureCelcius\":";
-  my_output += am.tempAirC;
-  my_output += ",\"AirTemperatureFahrenheit\":";
-  my_output += am.tempAirF;
-  my_output += ",\"HeatIndex\":";
-  my_output += am.heatIndex;
-  my_output += ",\"Light\":";
-  my_output += lightResistorVal;
-  my_output += ",\"ProbeTemperatureCelcius\":";
-  my_output += sm.tempSoilC;
-  my_output += ",\"ProbeTemperatureFahrenheit\":";
-  my_output += sm.tempSoilF;
-  my_output += ",\"Moisture\":";
-  my_output += moistureSensorVal;
-  my_output += ",\"WaterLevelStatus\":\"";
-  my_output += waterLevelStatus;
-  my_output += "\",\"WaterLevelValue\":";
-  my_output += waterLevelVal;
-  my_output += ",\"Location\":\"";
-  my_output += location;
-  my_output += "\",\"LightIsOn\":";
-  my_output += lightIsOn;
-  my_output += ",\"WaterPumptIsOn\":";
-  my_output += waterPumpIsOn;
+  // strings
+  my_output += "\"AppId\":\"";                      my_output += appId;             my_output += "\"";
+  my_output += ",\"Location\":\"";                  my_output += location;          my_output += "\"";
+  my_output += ",\"WaterLevelStatus\":\"";          my_output += waterLevelStatus;  my_output += "\"";
+  // numerics
+  my_output += ",\"AirTemperatureCelcius\":";       my_output += am.tempAirC;
+  my_output += ",\"AirTemperatureFahrenheit\":";    my_output += am.tempAirF;
+  my_output += ",\"HeatIndex\":";                   my_output += am.heatIndex;
+  my_output += ",\"HumidityPercent\":";             my_output += am.humidityAir;
+  my_output += ",\"LightPercent\":";                my_output += lightPercent;
+  my_output += ",\"LightValue\":";                  my_output += lightResistorVal;
+  my_output += ",\"LightIsOn\":";                   my_output += lightIsOn;
+  my_output += ",\"MoisturePercent\":";             my_output += moisturePercent;
+  my_output += ",\"MoistureValue\":";               my_output += moistureSensorVal;
+  my_output += ",\"ProbeTemperatureCelcius\":";     my_output += sm.tempSoilC;
+  my_output += ",\"ProbeTemperatureFahrenheit\":";  my_output += sm.tempSoilF;
+  my_output += ",\"WaterLevelValue\":";             my_output += waterLevelVal;
+  my_output += ",\"WaterPumptIsOn\":";              my_output += waterPumpIsOn;
   my_output += "}";
-    
+
   myKeen.setApiVersion(F("3.0"));
   myKeen.setProjectId(KEEN_PROJECT_ID);
   myKeen.setWriteKey(KEEN_WRITE_KEY);

}

void switchLights() {
  // todo - change the threshold to base100
  if (lightOnThreshold > lightResistorVal && !lightIsOn) {
    digitalWrite(LightSwitch, HIGH);
    lightIsOn = true;
  } 
  // todo - change the threshold to base100
  if (lightOnThreshold < lightResistorVal && lightIsOn) {
    digitalWrite(LightSwitch, LOW);
    lightIsOn = false;

}

void readLightResistor() {
  lightResistorVal = analogRead(lightPin);
  lightPercent = map(lightResistorVal, lightMinVal, lightMaxVal, 0, 100);
}

void readMoistureSensor() {
  moistureSensorVal = analogRead(hygroPin);
  moisturePercent = map(moistureSensorVal, moistureMinVal, moistureMaxVal, 0, 100);
}

void readWaterLevelSensor() {
  int val = analogRead(waterSensorPin);
  waterLevelVal = map(val, waterMinVal, waterMaxVal, 0, 100);
  
  if (val < waterLevelThreshold) {
   waterLevelStatus = "LOW";
