added smoothing functions