   // Note: If the sketch will run for more than ~24 hours, you probably want to query the time
   // server again to keep the current time from getting too skewed.
   unsigned long currentTime = lastPolledTime + (millis() - sketchTime);
-  
-  if ((currentTime - lastReading) >= (READING_DELAY_SECS * 1000)) {
-    lastReading = currentTime;
-
-    float currentTemp = readTempF();
-    Serial.println(currentTemp);
-  
-    dbWrite(currentTime, currentTemp);
-  }
+
+  Serial.print(F("Starting read. Current time: ")); Serial.println(currentTime);
+  lastReading = currentTime;
+
+  float currentTemp = readTempF();
+  Serial.print(F("Current temp: ")); Serial.println(currentTemp);
+
+  dbWrite(currentTime, currentTemp);
+  
+  Serial.println(F("\n\rDone writing. Delay till next read.\n\r\n\r"));
+  delay(READING_DELAY_SECS * 1000);
 }
 
 float readTempF() {

    www.fastrprint(F("\n"));
    www.fastrprint(F("Content-Type: application/json\n"));
    www.fastrprint(F("\n"));
    
    // Payload
    www.fastrprint(F("{\"time\":")); // Length: 8
    www.fastrprint(currentTimeStr);
    www.fastrprint(F("000,\"temp\":")); // Length: 11
    www.fastrprint(temp);
    www.fastrprint(F("}")); // Length: 1
  } else {
    Serial.println(F("Connection failed"));    
    www.close();

  return ((data[1] << 8) + data[0]) * 0.0625;
}

void dbWrite(unsigned long currentTime, float currentTemp) {
  // Generate time and date strings
  DateTime dt(currentTime);
