     calcCorrelation <<< dimGrid, dimBlock >>> (d_desc1, d_desc2, d_corr, d_m1, d_m2, d_sdv1, d_sdv2, d_response1, d_response2, size1, size2);
     cudaThreadSynchronize();
 
+    float * hCorr = (float *)malloc(corrSize);
+    cutilSafeCall(cudaMemcpy(hCorr, d_corr, corrSize, cudaMemcpyDeviceToHost));
+
+    /*for (int i = 0; i < 10; i++) {
+        for (int j = 0; j < 10; j++) {
+            cout << "[" << hCorr[i * size2 + j] << "]";
+        }
+        cout << endl;
+    }
+    free(hCorr);
+*/
+
     timings.tCalcCorrelation = clock() - myTime;
     myTime = clock();
 
-    /*calcBestCorr <<< blocksPerGrid, threadsPerBlock >>> (d_corr, d_bestCorr1, d_bestCorr2, points1.size(), points2.size());
+    calcBestCorr <<< blocksPerGrid, threadsPerBlock >>> (d_corr, d_bestCorr1, d_bestCorr2, points1.size(), points2.size());
     cudaThreadSynchronize();
 
     timings.tCalcBestCorr = clock() - myTime;

        __syncthreads();

        for (int k = 0; k < TILE_WIDTH; k++) {
            pVal += (tmpDesc1[ty][k] - tmpMean[0][ty]) * (tmpDesc2[tx][k] - tmpMean[1][tx]);
        }

        __syncthreads();
    }
    pVal /= (width - 1) * tmpSdv[0][ty] * tmpSdv[1][tx];
    
    corr[col * rows + row] = pVal;
}

__global__

    cout << "memCpy3 = " << clock() - tmpTime << endl;

    timings.tMemCpy = clock() - myTime;
    myTime = clock();

    cout << (size1 + size2) * sizeof(float) << endl;
    cutilSafeCall(cudaFree(d_m1));
