   tsortSmall<<<blocks, threads,4096>>>(d_data, d_data);
   // cudaThreadSynchronize();
   
-  for(int i = 0 ; i <= diff ; i += 1){ /* I made it <= and now it sorts? */
+  for(int i = 0 ; i < diff ; i += 1){ 
   
     for(int j = i; j >= 0; j -= 1){ 
-      cSwap<<<blocks/2,threads*2,0>>>(d_data, d_data,(1<<j)*SMALL_SIZE);
+      cSwaps<<<blocks,threads/2,0>>>(d_data, d_data,(1<<j)*SMALL_SIZE);
       
       //  cudaThreadSynchronize();
     }

    d_output[ix] = min(v1,v2);
    d_output[ix + stride] = max(v1,v2);
  
}

//* Assume input and output arrays have length 2^lenLog 

    } 
  }


  //for (int i = 0; i < LARGE_SIZE; ++i){
  //  printf("%d ", result[i]);
  //}
  
  printf("\n%s",passed ? "Passed!" : "Failed!");

  return 0;
