Added logic for reading and writing an ipuz file and preserving all data