added smoothing capability