         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() {

        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;
          digitalWrite(PROGRAMMING_CLOCK_PIN, LOW);
          delayMicroseconds(PROGRAMMING_MODE_COMMAND_DELAY);
        }

      }
      return false;
    }

    bool burnProgram() {
      if (_inProgrammingMode) {
        writeCommand(0x08);
        delayMicroseconds(PROGRAMMING_MODE_PROGRAMMING_TIME);
        writeCommand(0x0E);
        delayMicroseconds(PROGRAMMING_MODE_PROGRAMMING_END_TIME);
        return true;
      }
      return false;
    }
};

PICProgrammer* programmer;
