added extrapolation function