modified read_output