calculate correlation step 1