data postprocessing + distance matrix