Added PROGRAM and DONE command. Tuned read/write functions.