Added correlation function.