Working towards distance matrix