first draft of reader code