working on the correlation function section