add h5; tweak pdist