         for (int i = 0; i < 16; i++) {
           digitalWrite(PROGRAMMING_CLOCK_PIN, HIGH);
           delayMicroseconds(PROGRAMMING_MODE_COMMAND_DELAY);
-          result = (result << 1) | ((bool) digitalRead(PROGRAMMING_DATA_PIN)) ? 1 : 0;
+          result = (result >> 1) & 0x7FFF | (((bool) digitalRead(PROGRAMMING_DATA_PIN)) ? 0x8000 : 0);
           digitalWrite(PROGRAMMING_CLOCK_PIN, LOW);
           delayMicroseconds(PROGRAMMING_MODE_COMMAND_DELAY);
         }

  commands[2] = new ProgrammingModeControl();
  commands[3] = new IncAddressControl();
  commands[4] = new ReadTextWordControl();
  
  Serial.begin(57600);
  Serial.setTimeout(10);

        return result;
      }
      return -1;
    }

    bool writeWord(int w) {
      w = (w & 0x3F) << 1;
      
      if (_inProgrammingMode) {
        writeCommand(0x02);
        delayMicroseconds(PROGRAMMING_MODE_COMMAND_DELAY);

        for (int i = 0; i < 16; i++) {
          digitalWrite(PROGRAMMING_CLOCK_PIN, HIGH);
          digitalWrite(PROGRAMMING_DATA_PIN, (w & 1) == 1 ? HIGH : LOW);
          Serial.print("Writing: "); Serial.println((w & 1) == 1 ? HIGH : LOW);
          delayMicroseconds(PROGRAMMING_MODE_CLOCK_CYCLE_DELAY);
          digitalWrite(PROGRAMMING_CLOCK_PIN, LOW);
          delayMicroseconds(PROGRAMMING_MODE_CLOCK_CYCLE_DELAY);
        }
        
        digitalWrite(PROGRAMMING_DATA_PIN, LOW);
        return true;
      }
      return false;
    }

    bool incAddress() {
