   int digitsLeft = 0;
   int index = 0;
 
-  int splitLeft[]={-1,-1,-1.-1};
-  int splitRight[]={-1,-1,-1,-1};
+  int splitLeft[4]={-1,-1,-1,-1};
+  int splitRight[4]={0,0,0,0};
 
   //clear previous values of the num array
   for (int i=0; i<4; i++)


    splitNumber(testLoop);

    testLoop ++;

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

  }

  fractional = modf(n, &integral);
  int whole = int(integral);
  digitsLeft = numToArray(whole, splitLeft);
  int decimal = int(fractional * (pow(10,digitsLeft)));
  numToArray(decimal, splitRight);

  for (int i=0; i<digitsLeft; i++) {
      displayNum[i] = numbers[splitRight[i]];
      index++;
  }
  
  for (int j=0; j<4; j++) {
    if (splitLeft[j]!=-1)
      displayNum[j+index] = numbers[splitLeft[j]];
  }

  if (digitsLeft > 0)
    displayNum[digitsLeft]++;
}

int numToArray(int x, int store[]) {
  int left = 0;

  // if x is 0 to 9
  if (x < 10) {
    store[0] = x;
    left = 3;
  }
  //else if x is 10-99
  else if (x < 100) {
    store[1] = x / 10;
    store[0] = x % 10;
    left = 2;
  }
  //else if x is 100-999
  else if (x < 1000) {
    store[2] = x / 100;
    x = x % 100;
    store[1] = x / 10;
    store[0] = x % 10;
    left = 1;
  }
  //else if x is 1000-9999
  else if (x < 10000) {
    store[3] = x / 1000;
    x = x % 1000;
    store[2] = x / 100;
    x = x % 100;
    store[1] = x / 10;
    store[0] = x % 10;
    left = 0;
  }

  return left;
}

void updateShiftRegister(byte leds) {
  //sends byte to 8-bit shift register to turn on specific LEDs
