Neatened the code and added h5s