Added correlation function