improvements for hdf writing