Smoothing the data using moving averages