added the interpolation function