 	CUDA_SAFE_CALL( cudaMemcpyToSymbol(layers_dc,sim->layers,(sim->n_layers+2)*sizeof(LayerStruct)) );
 
 	// Copy bulk data to constant device memory
-	//CUDA_SAFE_CALL( cudaMalloc((void**)&bulks_dc,(sim->n_bulks+1)*sizeof(BulkStruct)) );
-	//printf("InitMem\n");
-	//printf("%i\n", sim->bulks);
 	CUDA_SAFE_CALL( cudaMemcpyToSymbol(bulks_dc,sim->bulks,(sim->n_bulks+2)*sizeof(BulkStruct)) );
-	// Copy bulk matrix to constant device memory
-	//CUDA_SAFE_CALL( cudaMalloc((void**)&bulk_info_dc,fhd_size*sizeof(short)) );
-	//CUDA_SAFE_CALL( cudaMemcpyToSymbol(bulk_info_dc,sim->bulk_info,fhd_size*sizeof(short)) );
 
 	// Copy num_photons_dc to constant device memory
 	CUDA_SAFE_CALL( cudaMemcpyToSymbol(num_photons_dc,&(sim->number_of_photons),sizeof(unsigned long long)));

	CUDA_SAFE_CALL( cudaMemcpyToSymbol(dir_dc,&(sim->dir),sizeof(float)));
	// Copy esp to constant device memory
	CUDA_SAFE_CALL( cudaMemcpyToSymbol(esp_dc,&(sim->esp),sizeof(float)));
	printf("esp=%f\n\n", *esp_dc);

	return 0;


  CUDA_SAFE_CALL(cudaMalloc((void**)&DeviceMem->a,NUM_THREADS*sizeof(unsigned int)));
  CUDA_SAFE_CALL(cudaMemcpy(DeviceMem->a,HostMem->a,NUM_THREADS*sizeof(unsigned int),cudaMemcpyHostToDevice));

	// Allocate bulk_info 3D matrix and copy to device memory
	CUDA_SAFE_CALL(cudaMalloc((void**)&DeviceMem->bulk_info,fhd_size*sizeof(short)));
	CUDA_SAFE_CALL(cudaMemcpy(DeviceMem->bulk_info,sim->bulk_info,fhd_size*sizeof(short), cudaMemcpyHostToDevice ));

