distance code

code added for distance from nearest pipe