Add simple moving average function.