Fixed distance calulation (off by order 10^3)