private ArrayDeque<Entry> getTopResults(String query, int num_results) {
		if(query == null) return null;
		if(query.equals("")) return null;
		PriorityQueue<Entry> results = new PriorityQueue<Entry>(10,new Entry());
		List<WordValueStore> ws = the_trie.getWordsWithPrefix(query);
		for(WordValueStore each_ws:ws){
			if(each_ws.getValue() != -Integer.MAX_VALUE)
				results.add(new Entry(each_ws.getWord(), each_ws.getValue()));
			List <Reference> refs = each_ws.getReferenceList();
			if(refs != null){
				for(Reference each_ref: refs){
					if(each_ref.getReference().isWord()){						
						results.add(new Entry(each_ref.getRefString(), each_ref.getReference().getValue()));
					}
				}
			}
		}
		ArrayDeque<Entry> top_results = new ArrayDeque<Entry>();
		for(int i=0; i< num_results && (!results.isEmpty()); i++){
			top_results.addLast(results.remove());
		}
		return top_results;
	}