simple correlation function