added interpolation and extrapolation