added distance computations