public static ArrayList<String> subspace(String method, int d, ArrayList<Term> sort){
		//Create array of terms only
		ArrayList<String> SortedTerms = new ArrayList<String>();
		for(Term e : sort){
			SortedTerms.add(e.text);
		}
		
		ArrayList<String> reduced = new ArrayList<String>();
		int D = 100*2^d;
		
		if(method.equals("frequent")){
			for(int i=0; i<D; i++)
				reduced.add(SortedTerms.get(i));
		}
		else if(method.equals("infrequent")){
			for(int i =0; i<D; i++)
				reduced.add(SortedTerms.get(sort.size()-i-1));
		}
		else if(method.equals("random")){
			ArrayList<Integer> randIntList = new ArrayList<Integer>();
			while(randIntList.size()<D){ 
				int rand=Tools.randInt(0, SortedTerms.size()-1);
				if(!randIntList.contains(rand)){
					randIntList.add(rand);
				}
			}
			for(int i=0;i<D;i++){
				reduced.add(SortedTerms.get(randIntList.get(i)));
			}
		}
		else throw new RuntimeException();
		return reduced;
	}