replaced quinput output with separate reader/writer