working xcorr analysis