add some distance functions
add comparator to create distance matrix