implemented cumulative moving average