Added comments on read and checkCommandForError functions.