add distance matrix