debugging of read and related functions