improved Dream file I/O