added the correlation calculation