   clock_t start, diff;
   
   // Size of array.
-  unsigned int SIZE = pow(2,25);
+  unsigned int SIZE = (unsigned int)pow(2, 21);// 65536;// 65025;// / 2;//(unsigned int)pow(2,25);
+  //unsigned int SIZE = 1024;// (unsigned int)pow(2, 20);
+
+  /*
+  // Possibly used to automate the SIZE value. For now, I found 2^21 to give good results 
+  size_t availableMemory, totalMemory, usedMemory;
+
+  cudaMemGetInfo(&availableMemory, &totalMemory);
+  usedMemory = totalMemory - availableMemory;
+  */
+
+
+  int blockSize;   // The launch configurator returned block size 
+  int minGridSize; // The minimum grid size needed to achieve the 
+				   // maximum occupancy for a full device launch 
+  int gridSize;    // The actual grid size needed, based on input size 
+
 
   // Sailors and monkeys
-  unsigned int monkeys = 1;
-  unsigned int max_sailors = 9;
+  unsigned char monkeys = 1;
+  unsigned char max_sailors = 9;
 
   // CPU memory pointers
   unsigned long long int *h_coc, da_solu=1;
   unsigned int *h_found, *h_solutions, *h_tot;
 
   // GPU memory pointers
-  unsigned long long int *d_coc, extra = 0;
+  unsigned long long int extra = 0;
   unsigned int *d_found, *d_solutions, *d_tot;
 
   // Allocate the space, CPU

  //cudamemset can be used for initializing data (say, all zeros). 10 times faster than cudaMemcpy zero array because it is done on the gpu directly.
  cudaMemset(d_solutions, 0, SIZE*sizeof(unsigned int));

  // Start timer
  start = clock();

  // Run the loop 
  for (unsigned int sailors=2; sailors<max_sailors+1;sailors++){

    printf("Running %u sailors, %u monkeys\n", sailors, monkeys);


  cudaFreeHost(h_solutions);

  // Free GPU memory
  //cudaFree(d_coc);  
  cudaFree(d_tot);
  cudaFree(d_found);
  cudaFree(d_solutions);
