Wrote some helper functions for using hdf5 files. This should make code more readable