   cudaFree (pres_mod);
   cudaFree (spec_rates);
   
-  status = cudaDeviceReset();
-  errorCheck (status);
+  errorCheck(cudaDeviceReset());
 	
 	return 0;
 }

	{
		spec_rates[tid + i * NUM] = local_spec_rates[i];
	}
}

/////////////////////////////////////////////////////////////////////////////
int main (int argc, char *argv[]) {

  int NUM = 16384;
  srand(1);

  // check for problem size given as command line option

		}
		checkCudaErrors (cudaGetDeviceProperties(&devProp, id));
	}
  
  	// initialize GPU
  
	// Allocate device memory
	Real* T_device;
	errorCheck(cudaMalloc (&T_device, size));
	// transfer memory to GPU
	errorCheck(cudaMemcpy (T_device, T_host, size, cudaMemcpyHostToDevice));
  
	// device array for pressure or density
	Real* pr_device;
	errorCheck(cudaMalloc (&pr_device, size));
	errorCheck(cudaMemcpy (pr_device, pres_host, size, cudaMemcpyHostToDevice));

	Real* conc_device;
	// device array for concentrations
	errorCheck(cudaMalloc (&conc_device, NSP * size));
	errorCheck(cudaMemcpy (conc_device, conc_host, NSP * size, cudaMemcpyHostToDevice));

  	//allocate fwd and reverse rate arrays
  	Real* fwd_rates;
  	errorCheck(cudaMalloc (&fwd_rates, FWD_RATES * size));

  	Real* rev_rates;
  	errorCheck(cudaMalloc (&rev_rates, REV_RATES * size));

  	//pres_mod
  	Real* pres_mod;
  	errorCheck(cudaMalloc (&pres_mod, PRES_MOD_RATES * size));

  	//finally species rates
  	Real* spec_rates;
  	errorCheck(cudaMalloc (&spec_rates, NSP * size));
	cuProfilerStart();
	//////////////////////////////
	rxnrates_driver <<<dimGrid, dimBlock>>> (NUM, T_device, conc_device, fwd_rates, rev_rates);
	cuProfilerStop();
#ifdef DEBUG
	//copy back and print
	errorCheck(cudaMemcpy (fwd_host, fwd_rates, FWD_RATES * size, cudaMemcpyDeviceToHost));
	printf("FWD_RATES:\n");
	for (int i = 0; i < FWD_RATES; i++)
		printf("%e\n", fwd_host[i * padded_size]);

	errorCheck(cudaMemcpy (rev_host, rev_rates, REV_RATES * size, cudaMemcpyDeviceToHost));
	printf("REV_RATES:\n");
	for (int i = 0; i < REV_RATES; i++)
		printf("%e\n", rev_host[i * padded_size]);
#endif
	/////////////////////////////////

	cuProfilerStart();
	//////////////////////////////
	presmod_driver <<<dimGrid, dimBlock>>> (NUM, T_device, pr_device, conc_device, pres_mod);
	cuProfilerStop();
#ifdef DEBUG
	//copy back and print
	errorCheck(cudaMemcpy (pres_mod_host, pres_mod, PRES_MOD_RATES * size, cudaMemcpyDeviceToHost));
	printf("PRES_MOD:\n");
	for (int i = 0; i < PRES_MOD_RATES; i++)
		printf("%e\n", pres_mod_host[i * padded_size]);
#endif
	/////////////////////////////////

	cuProfilerStart();
	//////////////////////////////
	specrates_driver <<<dimGrid, dimBlock>>> (NUM, fwd_rates, rev_rates, pres_mod, spec_rates);
	cuProfilerStop();
#ifdef DEBUG
	//copy back and print
	errorCheck(cudaMemcpy (spec_host, spec_rates, NSP * size, cudaMemcpyDeviceToHost));
	printf("SPEC_RATES:\n");
	for (int i = 0; i < NSP; i++)
		printf("%e\n", spec_host[i * padded_size]);
#endif
	/////////////////////////////////
  
  free (T_host);
  free (pres_host);
  free (conc_host);
#ifdef DEBUG
  //define print arrays
  free(fwd_host);
  free(rev_host);
  free(pres_mod_host);
  free(spec_host);
#endif
  
  cudaFree (T_device);
  cudaFree (pr_device);
