Simplified the extrapolation algorithm