Hopefully fixed the moving average problem