         swg, tra, numNeighbours,
         graphSwing, graphTract);
 
-    cudaEventCreate(&stop);
-    cudaEventRecord(stop, 0);
-    cudaEventSynchronize(stop);
-    cudaEventElapsedTime(&time, start, stop);
-    cudaEventDestroy(start);
-    cudaEventDestroy(stop);
+    cudaError_t code = cudaGetLastError();
+    if (code != cudaSuccess)
+    {
+      printf("Error in kernel 1.\n%s\n", cudaGetErrorString(code));
+      exit(EXIT_FAILURE);
+    }
+
+    //cudaEventCreate(&stop);
+    //cudaEventRecord(stop, 0);
+    //cudaEventSynchronize(stop);
+    //cudaEventElapsedTime(&time, start, stop);
+    //cudaEventDestroy(start);
+    //cudaEventDestroy(stop);
     printf("time: graph swing and traction.\n");
     printf("(ms)  %f.\n", time);
 
-    cudaEventCreate(&start);
-    cudaEventRecord(start, 0);
+    //cudaEventCreate(&start);
+    //cudaEventRecord(start, 0);
+
+    printf("Launching %i blocks of size %i. Which is %i threads.\n", numblocks,
+      BLOCK_SIZE, numblocks * BLOCK_SIZE);
+    printf("We have %i vertices and %i edges.\n", g->numvertices, g->numedges);
 
     // Compute graph speed, vertex forces, speed and displacement.
     fa2kernel<<<numblocks, BLOCK_SIZE>>>(

    __syncthreads();
    if (tx < stride)
    {
      scratch[base] += scratch[base + stride];
    }

    stride >>= 1;

{
  __shared__ float scratch[BLOCK_SIZE * 2];

  // Setup local data to perform reduction.
  unsigned int tx = threadIdx.x;
  unsigned int base = tx + (blockIdx.x * BLOCK_SIZE * 2);
