updated radialDistFunction to the good version