 	scan_naive<unsigned int, block_size>(unique);
 	
 	// determine start location of each unique value in the array
-	__shared__ unsigned int start[block_size+1];
+	// save shared memory by reusing the temp data in the unique[] array
+	unsigned int *start = &unique[block_size];
 	
 	if (is_unique)
 		start[unique[threadIdx.x]] = threadIdx.x;

		return;
		}	
	
	printf("GPU/simple/sort     : ");
	printf("%f ms\n", avg_t);
	}


	bin_id_pair res;
	res.bin = bin;
	res.id = id;
	res.start_offset = 0;
	return res;
	}
	
