lets both read from file and write to it