updated to receive either HDF5 or gadget files