corrected a side effect in the interpolation function