changes to moving average prototype