 
 		
 		for (index_t t = 0; t < iter_nb_; ++t){
-			cudaMalloc((void**)&dev_ret_, sizeof(double) * points_nb_ * 4);
-			
+			//
+			//if (t > 20) k_ = 10;
 			knn_search(); 
 				CudaStopWatcher iter_watcher("iteration");
-				iter_watcher.start();				
+				iter_watcher.start();
+				cudaMemset(dev_ret_, 0, sizeof(double) * points_nb_ * 4);
 				cudaMemcpy(dev_points_, points_, DOUBLE_SIZE * points_nb_ * dimension_, cudaMemcpyHostToDevice);
 				cudaMemcpy(dev_points_nn_, points_nn_, sizeof(index_t) * points_nb_ * k_, cudaMemcpyHostToDevice);
 				cudaMemcpy(dev_facets_nn_, facets_nn_, sizeof(index_t) * facet_nb_ * 1, cudaMemcpyHostToDevice);

			free(facets_nn_);
			facets_nn_ = nil;
		}
		
		if (points_ != nil){
			free(points_);
			points_ = nil;
		}
		//delete knn_;
	}


				);

			//now we get the clipped polygon stored in "polygon", do something.
			/*action(
				current_polygon,
				current_seed,
				retdata
				);*/
			MyAtomicAdd(&retdata[current_seed], 1);
			MyAtomicAdd(&retdata[2000], 1);
			//store_info(tid, current_seed, current_polygon, &retdata[tid * 400 + counter * 40]);
			//Propagate to adjacent seeds
			for (index_t v = 0; v < current_polygon.vertex_nb; ++v)
