finished implementing reader/writer