change distance matrix