Added routine to write eeprom. Not tested