public void make_pivot_hier(node head){
		
		// stop if so less than OUTLIERS_SIZE objects present
		if(head.list_objects.size() < PIVOT_SIZE_TOTAL){
			//add all children to the children and return
			for(finger_print f: head.list_objects){
				head.children.add(new node(f));
			}
			//System.out.println("XX "+head.list_objects.size());
			return;
		}
		
		ArrayList<node> pivot_lst= new ArrayList<node>();
		
		Random r= new Random();
		
		// choose pivots
		// has to be done better
		
		//remove for non sampling
		int maxsize=Math.max(PIVOT_SIZE_TOTAL,(int)(0.001*head.list_objects.size()));
		ArrayList<Integer> num= new ArrayList<Integer>();			
		for(int k=0;k<maxsize;k++){
			int l=r.nextInt(head.list_objects.size());
			while(num.contains(l)){
				l=r.nextInt(head.list_objects.size());
			}
			num.add(l);
		}	
		
		
		
		
		for(int i=0;i<PIVOT_SIZE_TOTAL;i++){			
			//choose random
			//int j=r.nextInt(head.list_objects.size());
			
			//choose far away points
			
			
			int j=get_farthest_sampling(head.list_objects,pivot_lst,num);
			
		
			//without sampling
			//int j=get_farthest(head.list_objects,pivot_lst);
			
			
			
			/*then the same*/
			pivot_lst.add(new node(head.list_objects.get(j)));
			head.list_objects.remove(j);	
		}
	
		// set closest pivot
		for(finger_print p : head.list_objects){
			p.set_sim_pivot(pivot_lst);
			p.closest_pivot.set_object(p);
		}

		// set the children to pivot_lst
		head.children=pivot_lst;	

		//recursive call
		for(node pivot : pivot_lst){
			make_pivot_hier(pivot);
		}
			
		return;
	}