added distance matrix class