improvement for moving average elaboration