working on moving average smoothing