distance computation
drop dups