     refreshLoop++;
   }
 
-  //test timer loop, increases count by one at each interval of countInterval
-  if (currentCount - previousCount > countInterval) {
-    previousCount = currentCount;
-
-    splitNumber(countLoop);
-
-    countLoop ++;
-
-    if (countLoop == 10000)
-      countLoop = 0;
-  }
+  testCaseAllNum();
 }
 
 void clearLEDs() {

void loop() {
  //current timer variables to reset at each iteration
  unsigned long currentRefresh = micros();  //get current microseconds for refresh counter
  unsigned long currentCount = millis();  //get current milliseconds for counting counter

  clearLEDs();


   digitalWrite(latchPin, LOW);
   shiftOut(dataPin, clockPin, LSBFIRST, leds);
   digitalWrite(latchPin, HIGH);
}

//global variables for the test function
const long testInterval = 500; //counter delay in milliseconds
long previousTestTime = 0; //previous count time
int testLoop = 0; //counter for counting loop

void testCaseAllNum() {
  //test case, a loop timer that runs through each integer from 0 to 9999
  unsigned long currentTestTime = millis();  //get current milliseconds for counting counter

  if (currentTestTime - previousTestTime > testInterval) {
    previousTestTime = currentTestTime;

    splitNumber(testLoop);

    testLoop ++;

    //reset loop to 0 at end of displayable integers
    if (testLoop == 10000)
      testLoop = 0;
  }
}