PulsarCrossCorr_v2: changed '<' to '<=' in next-template-function
PulsarCrossCorr_v2: Change the order of looping in next-template function to make the loop of frequency innermost