Simpler version of distance calculation.