     Serial.print("Disconnected from central: ");
     Serial.println(central.address());
   }
+
+   delay(200);
 }
 
-void updateTempLevel() {
+float readTemperature() {
   int val = analogRead(A0);
 
-  float R = 1023.0/((float)val)-1.0;
+  float R = 1023.0/((float)val*0.66)-1.0;
   R = 100000.0*R;
 
-  float temperature = 1.0/(log(R/100000.0)/B+1/298.15)-273.15;//convert to temperature via datasheet ;
+  return (1.0/(log(R/100000.0)/B+1/298.15)-273.15);
+}
 
-
+void updateTempLevel(float temperature) {
   if (temperature != oldTemperature) {
     Serial.print("Temp is % is now: ");
     Serial.println(temperature);

    oldTemperature = temperature;
  }
}

      // if 200ms have passed, check the battery level:
      if (currentMillis - previousMillis >= 200) {
        previousMillis = currentMillis;
        float newTemperature = readTemperature();
        printTemperature(newTemperature);
        updateTempLevel(newTemperature);
      }
    }
    // when the central disconnects, turn off the LED:
