public void bestPages(String query){
		DecimalFormat fmt = new DecimalFormat("0.00");
		double [] common = new double [docCount];
		double [] docSpecific = new double [docCount];
		double [] simValues = new double [docCount];
		double queryWeights=0;
		double tfidf = 0;
		Query search = new Query(termIndex);
		for (Term term : termIndex){
			//System.out.println("term: " + term);
			for (String word : query.split(" ")){
				word = word.toLowerCase();
				// Determines if term is in the query 
				if (term.getName().equals(word)){
					queryWeights += Math.pow(search.getWiq(term),2);
					//System.out.println("Wiq values: " + queryWeights);
					for (Occurrence occ : term.getDocsList()){
						tfidf = search.getTFIDF(term.getName(), occ.getDocName());//wid
						common[docList.indexOf(occ.getDocName())] += (tfidf*(search.getWiq(term)));
					}
				}				
			}
			for(Occurrence occ : term.getDocsList()){
				
				double tfSquared = Math.pow((search.getTFIDF(term.getName(), occ.getDocName())), 2);
				docSpecific[docList.indexOf(occ.getDocName())] += tfSquared;
			}
			
		}
		for (int i=0; i<docList.size(); i++){
			double a = Math.sqrt(docSpecific[i]);
			double b = Math.sqrt(queryWeights);
			
			simValues[i] = common[i]/(a*b);
		}
		double max =0;
		int index =0;
		for (int i =0; i< docCount; i++){
			double a = simValues[i];
			if (a >= max){
				max = a;
				index=i;
			}
		}
		//System.out.println("common[]: " + Arrays.toString(common));
		//System.out.println("DocSpec: " + Arrays.toString(docSpecific));
		//System.out.println("simValues: " + Arrays.toString(simValues));
		//System.out.println("common at max: " + fmt.format(common[index]));
		//System.out.println("specifics at max: " + fmt.format(docSpecific[index]));
		//System.out.println("queryWeight at max: " + queryWeights);
		//printQuery(query);
		max *= graph.inDegree(docList.get(index));
		if (max == 0){
			System.out.println(" not found");
		}else{
		System.out.println(" in " + docList.get(index) + ": " + fmt.format(max) );
		}
	}