 	checkCudaErrors(cudaMalloc((void**)&dev_mesh_vertex_pointer, sizeof(double) * mesh_vertex_nb * 3));
 	checkCudaErrors(cudaMalloc((void**)&dev_mesh_facet_index, sizeof(int) * mesh_facet_nb * 3));
 	checkCudaErrors(cudaMalloc((void**)&dev_seedsInformation, sizeof(double) * points_nb * 4));
-	checkCudaErrors(cudaMalloc((void**)&dev_seedsPolyonNumber, sizeof(int) * points_nb));
-
+	//checkCudaErrors(cudaMalloc((void**)&dev_seedsPolyonNumber, sizeof(int) * points_nb));
+	checkCudaErrors(cudaMalloc((void**)&dev_test_seeds, sizeof(double) * points_nb * 4));
 	//allocate test memory
+	/*
 	checkCudaErrors(cudaMalloc((void**)&dev_test_dis, sizeof(double) * points_nb));
 	checkCudaErrors(cudaMalloc((void**)&dev_test_center, sizeof(double) * 3));
 	checkCudaErrors(cudaMalloc((void**)&dev_test_index, sizeof(int) * points_nb));
-	checkCudaErrors(cudaMalloc((void**)&dev_test_seeds, sizeof(double) * points_nb * 4));
+	
 	checkCudaErrors(cudaMalloc((void**)&dev_test_polygon, sizeof(int) * points_nb));
-
+	*/
 	//pass the data from host to device
 	checkCudaErrors(cudaMemcpy(dev_seeds_pointer, host_seeds_pointer, sizeof(double) * points_nb * 3, cudaMemcpyHostToDevice));
 	checkCudaErrors(cudaMemcpy(dev_mesh_vertex_pointer, host_mesh_vertex_pointer, sizeof(double) * points_nb * 3, cudaMemcpyHostToDevice));
-	checkCudaErrors(cudaMemcpy(dev_mesh_facet_index, host_facet_index, sizeof(int) * points_nb * 3, cudaMemcpyHostToDevice));
+	checkCudaErrors(cudaMemcpy(dev_mesh_facet_index, host_facet_index, sizeof(int) * mesh_facet_nb * 3, cudaMemcpyHostToDevice));
 
 	checkCudaErrors(cudaMemcpyToSymbol(SeedsInformation, &dev_seedsInformation, sizeof(double*), size_t(0), cudaMemcpyHostToDevice));
-	checkCudaErrors(cudaMemcpyToSymbol(SeedsPolygon_nb, &dev_seedsPolyonNumber, sizeof(int*), size_t(0), cudaMemcpyHostToDevice));
+	/*checkCudaErrors(cudaMemcpyToSymbol(SeedsPolygon_nb, &dev_seedsPolyonNumber, sizeof(int*), size_t(0), cudaMemcpyHostToDevice));*/
 	
 	int x = (int)sqrt(mesh_facet_nb);
 	int y = (int)(mesh_facet_nb / x + 1);
 	//set the block
-	compute_RVD << < x, y >> >(dev_seeds_pointer, points_nb, dev_mesh_vertex_pointer, mesh_vertex_nb, dev_mesh_facet_index, mesh_facet_nb,
-		dev_test_dis, dev_test_center, dev_test_index, dev_test_seeds, dev_test_polygon);
-
+	compute_RVD << < x, y >> >(dev_seeds_pointer, points_nb, dev_mesh_vertex_pointer, mesh_vertex_nb, dev_mesh_facet_index, mesh_facet_nb, dev_test_seeds
+		/*dev_test_dis, dev_test_center, dev_test_index, dev_test_seeds, dev_test_polygon*/);
+	/*
 	checkCudaErrors(cudaMemcpy(host_test_dis, dev_test_dis, sizeof(double) * points_nb, cudaMemcpyDeviceToHost));
 	checkCudaErrors(cudaMemcpy(host_test_cen, dev_test_center, sizeof(double) * 3, cudaMemcpyDeviceToHost));
 	checkCudaErrors(cudaMemcpy(host_test_index, dev_test_index, sizeof(int) * points_nb, cudaMemcpyDeviceToHost));
+	checkCudaErrors(cudaMemcpy(host_test_polygon, dev_test_polygon, sizeof(int) * points_nb, cudaMemcpyDeviceToHost));
+	*/
 	checkCudaErrors(cudaMemcpy(host_test_seeds, dev_test_seeds, sizeof(double) * points_nb * 4, cudaMemcpyDeviceToHost));
-	checkCudaErrors(cudaMemcpy(host_test_polygon, dev_test_polygon, sizeof(int) * points_nb, cudaMemcpyDeviceToHost));
 	//printf("Thread 1:\n");
 	//printf("center position : %.17lf, %.17lf, %.17lf \n", host_test_cen[0], host_test_cen[1], host_test_cen[2]);
 	//printf("nearest 20 points' index:\n");

		}
		//printf("seeds %d : %.16lf, %.16lf, %.16lf, , %.16lf \n", i, host_test_seeds[i * 4 + 0]
			//, host_test_seeds[i * 4 + 1], host_test_seeds[i * 4 + 2], host_test_seeds[i * 4 + 3]);
		//fout << i << ':' << host_test_seeds[i * 4 + 0] << ' ' << host_test_seeds[i * 4 + 1] << ' ' << host_test_seeds[i * 4 + 2] << ' ' << host_test_seeds[i * 4 + 3] << endl;
	}
	for (int i = 0; i < points_nb; ++i)
	{
		//fout << i << ':' << host_test_polygon[i] << endl;
	}
}
				MyAtomicAdd(&SeedsInformation[current_seed * 4 + 2], temp_pos.z);
				MyAtomicAdd(&SeedsInformation[current_seed * 4 + 3], current_weight);


			}
			/*------------------------ test part -------------------------*/
			//__syncthreads();
			//pass the data to test data
			/*
		if (tid == 162)
		{

		for (int i = 0; i < 20; ++i)
		{
		test_index[i] = nearest_points[i];
		}



		for (int i = 0; i < seeds_nb; ++i)
		{
		test_polygon_nb[i] = SeedsPolygon_nb[i];
		}
		}
		*/
		}
		__syncthreads();
		for (int i = 0; i < seeds_nb * 4; ++i)
		{
			ret_seeds[i] = SeedsInformation[i];
		}
		free(nearest_points);
		free(polygon);
	}
}
extern "C" void runCuda(double* host_seeds_pointer, double* host_mesh_vertex_pointer,
	int* host_facet_index, int points_nb, int mesh_vertex_nb, int mesh_facet_nb)
{
