found bug in moving averages