 
   printf("eleven\n");
 
-  cudaErrorCheck(cudaMemcpy(sumOverBlock2, sumOverBlock, numBlocks * sizeof(Aggregator), cudaMemcpyDeviceToHost));
+  errorCheck(cudaMemcpy(sumOverBlock2, sumOverBlock, numBlocks * sizeof(Aggregator), cudaMemcpyDeviceToHost));
 
   printf("twelve\n");
 
-  cudaErrorCheck(cudaFree(sumOverBlock));
+  errorCheck(cudaFree(sumOverBlock));
 
   printf("thirteen\n");
 

}

int main(int argc, char** argv) {
  int numBlocks = 1;
  int numThreadsPerBlock = 1;
  int sharedMemoryOffset = 0;

  printf("one\n");

  initialize<<<numBlocks, numThreadsPerBlock, numThreadsPerBlock * sizeof(Aggregator)>>>(sharedMemoryOffset);
  cudaErrorCheck(cudaPeekAtLastError());
  cudaErrorCheck(cudaDeviceSynchronize());

  printf("two\n");


  printf("eight\n");

  Aggregator* sumOverBlock = NULL;
  errorCheck(cudaMalloc((void**)&sumOverBlock, numBlocks * sizeof(Aggregator)));

  printf("nine\n");

  extractFromBlock<<<numBlocks, 1, sharedMemoryOffset + numThreadsPerBlock * sizeof(Aggregator)>>>(sharedMemoryOffset, numThreadsPerBlock, sumOverBlock);
  errorCheck(cudaPeekAtLastError());
  errorCheck(cudaDeviceSynchronize());

  printf("ten\n");

