added cdist and renamed old cdist into pairwise_cdist