I don't see any loop() or setup(). Did you know that the EEPROM library, can write an 'int' to EEPROM in one call?