added autocorrelation routine