   
   /* Allocate GPU arrays */   
   cudaMalloc((void**)&dvalues, sizeof(int) * LARGE_SIZE ); 
-  cudaMalloc((void**)&dresult, sizeof(int) * LARGE_SIZE ); 
   cudaMemcpy(dvalues, values, sizeof(int) * LARGE_SIZE, cudaMemcpyHostToDevice);
   //cSwap<<<BLOCKS/2, SMALL_SIZE,0>>>((int*)dvalues,(int*)dresult,1);
-  sort(dvalues,dvalues); // dresult);
+  sort(dvalues); 
   cudaMemcpy(result, dvalues, sizeof(int) * LARGE_SIZE , cudaMemcpyDeviceToHost);
   cudaFree(dvalues);
-  cudaFree(dresult);
+ 
  
 
 


//* Assume input and output arrays have length 2^lenLog 
//* Small kernels work on SMALL_SIZE inputs. Assume lenLog >= ssLog > 0
void sort(int *d_input,
	  int *d_output)
	  //	  uint ssLog,
	  //  uint lenLog)
{
   
  uint arrayLength = 1 << LOG_LARGE_SIZE;

  int *result; 

  int *dvalues;

  values = (int*)malloc(LARGE_SIZE*sizeof(int));
  result = (int*)malloc(LARGE_SIZE*sizeof(int));
