   sensors.requestTemperatures();
   temp = sensors.getTempCByIndex(0);
 
-  m1 = analogRead(m1Pin);
-  m2 = analogRead(m2Pin);
-  m3 = analogRead(m3Pin);
+  String muxMessage = "";
+  for(byte pin=0;pin<8;pin++){
+    selectMuxPin(pin);
+    int pinValue = analogRead(muxOutPin);
+    muxMessage += String(pin+5) + ":" + pinValue + ",";
+  }
 
   digitalWrite(3,LOW);
   String lightMsg = String(LIGHT_SENSOR_ID) + ":" + lightLevel;
   String tempMsg = String(TEMP_SENSOR_ID) + ":" + temp;
-  String m1Msg = String(MOISTURE_SENSOR_1_ID) + ":" + m1;
-  String m2Msg = String(MOISTURE_SENSOR_2_ID) + ":" + m2;
-  String m3Msg = String(MOISTURE_SENSOR_3_ID) + ":" + m3;
-  
-  sendRadioMessage(m1Msg+","+m2Msg+","+m3Msg+","+lightMsg+","+tempMsg);
+
+  sendRadioMessage(muxMessage+lightMsg+","+tempMsg);
   delay(600000);
-  
-}
+
+}

/* Analog */
const int lightSensorPin = 0;
const int m1Pin = 1;
const int m2Pin = 2;
const int m3Pin = 3;

/* Digital */
const int tempSensorPin = 2;

// Setup a oneWire instance to communicate with any OneWire devices 
// (not just Maxim/Dallas temperature ICs)
OneWire oneWire(tempSensorPin);
 
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);


  pinMode(3,OUTPUT);
  digitalWrite(3,LOW);
  sensors.begin();

  // Set up mux
  for (int i=0; i<3; i++)
  {
    pinMode(muxPins[i], OUTPUT);
    digitalWrite(muxPins[i], LOW);
  }
  pinMode(muxOutPin, INPUT);

}

void sendRadioMessage(String s){
  char msgChar[100];
  s.toCharArray(msgChar,100);
  radio.write(&msgChar,sizeof(msgChar));
}

void selectMuxPin(byte pin) {
  if(pin >7){
    return;
  }

  digitalWrite(muxPins[0], bitRead(pin,0));
  digitalWrite(muxPins[1], bitRead(pin,1));
  digitalWrite(muxPins[2], bitRead(pin,2));
}

void loop() {
