now adding the correlation code