added linear interpolation function