write reader that parses to pairs