       if (Serial) {
         Serial.print(temp);
         Serial.print(" ");
+        Serial.print(readAmb());
+        Serial.print(" ");
         Serial.println(vol);
       }
       temp = 0;
       vol = 0;
     }
   } else {
-    
-    if (alarm && readTemp() <= ref + 5)
+    if (alarm && readTemp() <= readAmb() + 5)
       cycle++;
-    else if (!alarm && readTemp() > ref + 5)
+    else if (!alarm && readTemp() > readAmb() + 5)
       cycle++;
     else
       cycle = 0;

int mphonePin = 0;
int buzzPin = 10;
int cycle = 0, vol = 0;
double temp = 0, ref = 0;
boolean flash = false, sample = false, alarm = false, buzz = LOW;

void setup(){

  }
}

float mlxRead(byte loc){
  int dev = 0x5A<<1;
  int data_low = 0;
  int data_high = 0;
  int pec = 0;
  
  i2c_start_wait(dev+I2C_WRITE);
  i2c_write(loc);
  
  // read
  i2c_rep_start(dev+I2C_READ);
