   int segmentData = digitValues[value];
   
   shiftOut(whichSegmentData, segmentShiftRegisterClockPin, MSBFIRST, segmentData);
-  shiftOut(whichDigitData, shiftRegisterClockPin, MSBFIRST, digitData);
+  shiftOut(whichDigitData, digitShiftRegisterClockPin, MSBFIRST, digitData);
 
   digitalWrite(registerClockPin, HIGH);
   digitalWrite(registerClockPin, LOW);

  unsigned long now = millis();
  if (now > lastIncrement + 20)
  {
    valueToDisplay++;
    lastIncrement = now;
  }
}

void writeValue(byte digit, byte value)


void setup()
{
  //Serial.begin(9600);
  //Serial.println();

  pinMode(ledPin, OUTPUT);
  pinMode(hackPin, OUTPUT);
  pinMode(outputDisabledPin, OUTPUT);
  pinMode(registerClockPin, OUTPUT);  
  pinMode(whichSegmentData, OUTPUT);
  pinMode(segmentShiftRegisterClockPin, OUTPUT);  
  pinMode(whichDigitData, OUTPUT);
  pinMode(digitShiftRegisterClockPin, OUTPUT);

  digitalWrite(outputDisabledPin, LOW);
  digitalWrite(registerClockPin, LOW);
  digitalWrite(whichSegmentData, LOW);
  digitalWrite(segmentShiftRegisterClockPin, LOW);
  digitalWrite(whichDigitData, LOW);
  digitalWrite(digitShiftRegisterClockPin, LOW);
  
  //shiftOut(whichSegmentData, segmentShiftRegisterClockPin, MSBFIRST, 255);
  //shiftOut(whichDigitData, digitShiftRegisterClockPin, MSBFIRST, 0);
  //digitalWrite(registerClockPin, HIGH);
  //digitalWrite(registerClockPin, LOW);

  valueToDisplay = 1234;
  writeValue(0, valueToDisplay);
}

bool toggle = false;
unsigned long lastToggle = 0;

void loop2()
{
  unsigned long now = millis();

  if (now - lastToggle > 3000)
  {
    toggle = !toggle;
    lastToggle = now;
  }

  unsigned long pinValue = toggle ? HIGH : LOW;
  digitalWrite(ledPin, pinValue);
  digitalWrite(hackPin, pinValue);
  //digitalWrite(registerClockPin, pinValue);
  //digitalWrite(whichSegmentData, pinValue);
  //digitalWrite(segmentShiftRegisterClockPin, pinValue);
  //digitalWrite(whichDigitData, pinValue);
  //digitalWrite(digitShiftRegisterClockPin, pinValue);
}

void loop()
{
  // Arduino pow function is approximate and sometimes will end up rounding down when casting to int
  int place = pow(10, 3 - segmentIndex) + 0.5f;
  int segmentValue = (valueToDisplay / place) % 10;

