add distance function