separate function for cross correlation calculation