added total distance computations