implemented smoothing