added cross correlation function