fixed a bug regarding the precision for the interpolation of the distance