 void updateStats(boolean debug)
 {
 
-  if (now() - startOfPeriod1 <= monPeriod1)
+  if (now() - startOfPeriod1 <= monPeriod1Len)
   {
     count_t1++;
   }

  mPos = ((float)currV - (float)minV) / (float)absV;
  int nPos = round(len * mPos);
  result = String("[");
  for (int i=1;i<=len;i++)
  {
    if (i <= nPos)
    { 
      result = String(result) + String("#");
      }
    else
    {
      result=String(result) + String("-");
    }
  }
  result = String(result) + String("]");

      tt1mTrend[i] = (tt1m[i] - tt1mLast[i]) / count_t1;
      tt1mLast[i] = tt1m[i];
      tt1m[i] = 0;
      if (debug) 
      {
        Serial.print("[DBG] TREND "); Serial.print(i); Serial.print(":"); Serial.println(tt1mTrend[i]);
        Serial.print("[DBG] TTL: "); Serial.println( makeForecast(i) );
      }
    }

    count_t1 = 1;
  }

    tt1m[i] = tt1m[i] + sensors.getTempC(thermalSensor[i]);
    tt1m_avg[i] = round(tt1m[i] / count_t1);



  if (now() - startOfPeriod2 <= monPeriod2Len)
  {
    count_t2++;
  }
