add autocorrelation function