added seven program modes with EEPROM write to store current mode