adding a read_from_write_to function