 
 void ResetClock()
 {
-  for (uint32_t* x = 0; x <= maximumEepromAddress; x++)
+  for (uint32_t* x = 0; x < eepromSize; x++)
   {
     eeprom_write_dword(x, 0xFFFFFFFF);
   }

const int potentiometerCeiling = 1000;
const float gearRatio = 2.0;
// ATMega328P has 1024 bytes of EEPROM and we're addressing it as DWORDS
const uint32_t* maximumEepromAddress = (uint32_t*)1024 - 1;

// Switches using the Bounce library for debouncing
Bounce onOffSwitch = Bounce();

{
  secondsOfOperation = 0;
  uint32_t clockValue = 0;

  // Read through the EEPROM buffer looking for a place where either we read a value smaller than
  // the previous one we read or we read an uninitialized value or we get to the end of the EEPROM
  for (nextClockBufferLocation = 0; nextClockBufferLocation < eepromSize; nextClockBufferLocation++)
  {
    clockValue = eeprom_read_dword(nextClockBufferLocation);
    if (clockValue >= secondsOfOperation && clockValue < 0xFFFFFFFF)
