Updated code for data correlation.