Updated smoothing algorithm