       reset = 6;
     }
   }
+  
   // save the current state as the last state, 
   // for next time through the loop
   lastButtonState = buttonState;

  // Write a digit at a time for 20 ticks.
  n = ticks/divide;
  
  // Most significant digit
  if(n == 1)
  {
    digitalWrite(digit2pin,0);
    digitalWrite(digit3pin,0);
    sevenSegWrite(value % 1000 / 100, 1);
    digitalWrite(digit1pin,1);

  }

  // Middle significant digit  

  {
    digitalWrite(digit1pin,0);
    digitalWrite(digit3pin,0);
    if (significantState == LOW)
    {
      sevenSegWrite(value % (100*moduloExtra) / (10*moduloExtra), 0);
    }
    else
    {
      sevenSegWrite(value % (100*moduloExtra) / (10*moduloExtra), 1);
    }
    digitalWrite(digit2pin,1);
  }

  // Least significant digit  
