added smoothing