 	  // create array of random numbers: we need num_subboots*num_bins random numbers
 	  
  	  curandGenerator_t gen;
-		//cudaSafeCall(cudaMalloc((void**)&d_irand,  (num_bins)*(num_subboots) * sizeof(float)));
-	  cudaSafeCall(cudaMalloc((void**)&d_irand,  (num_bins)*(num_subboots) * sizeof(unsigned int)));
+if (BSTRAP==3) cudaSafeCall(cudaMalloc((void**)&d_irand,  (num_bins)*(num_boots) * sizeof(unsigned int)));
+else  cudaSafeCall(cudaMalloc((void**)&d_irand,  (num_bins)*(num_subboots) * sizeof(unsigned int)));
+
 	  curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_DEFAULT);
 	  curandSetPseudoRandomGeneratorSeed(gen, 1234ULL);
-	    //curandGenerateUniform(gen, d_irand, (num_bins)*(num_subboots));
-      curandGenerate(gen, d_irand, (num_bins)*(num_subboots));
+if (BSTRAP==3) 	curandGenerate(gen, d_irand, (num_bins)*(num_boots));
+else curandGenerate(gen, d_irand, (num_bins)*(num_subboots));
 	  cudaSafeCall( cudaDeviceSynchronize() );
 
 	  timeSinceLastTimer = elapsed_time(&gpu_timer);

//Fischer shuffle algorithm to replace our bins randomly
//sample without replacement once for indexes to replace
	for(int i=0;i<num_bins-1;i++){
		int Rand=(((num_bins-i)*rand())/RAND_MAX );
		int temp=exclusive_random[num_bins-i-1];
		exclusive_random[num_bins-i-1]=exclusive_random[Rand];
		exclusive_random[Rand]=temp;



// ************************************* Bootstrap Kernel ************************************** //
//__constant__ int bins;
// most bias, but quickest (rand in (0,bins-blockDim.x))
__global__ void bootstrap(float *g_odata, float *g_idata, unsigned int *g_irand)
{
