Add distance calculation.