private void buildScoreTable(){
		
		double final_score[] = new double[N+1];
		int num = 0;
	
		for (String key:norm.keySet())
		{
			
			try {
				 
				String path ="./index/" + key.trim() +".txt";
				if(!new File(path).exists())
					continue;
				FileInputStream fStream = new FileInputStream(path);
				
				DataInputStream in = new DataInputStream(fStream);
				BufferedReader br = new BufferedReader(new InputStreamReader(in)); 
				String line = "";
				
				//variable to ignore the first row
				int i = 1;

				while ((line = br.readLine()) != null)
				{
					//ignore the first row
					if (i == 1){
						i++;
						continue;
					}
					//e.g.line 4:999 0.4314243
				    //final_score[999] += 0.4314243
					else{
						
						String[] docID_norm = line.split(",");
						
						//count the number of document need to be consider
						if (final_score[Integer.parseInt(docID_norm[0].trim())] == 0.0)
							num++;
						
						//qi*di
						final_score[Integer.parseInt(docID_norm[0].trim())] += Double.parseDouble(docID_norm[1].trim()) 
								* norm.get(key);
					}
				}
				in.close();
				
			}catch(Exception e){
				e.printStackTrace();
			}
		}
		
		double final_score_index[][] = new double[num][2];
		int index = 0;

		//Modify the new final score of deleting the zero index
		for (int i = 1;i < N + 1;i++){

			if (final_score[i] > 0){
			 final_score_index[index][0] = i;
			 final_score_index[index++][1] =  final_score[i];
			}		
		}
		//rank the result of high score to low score
		Arrays.sort(final_score_index, new Comparator<double[]>() {
		    public int compare(double[] a, double[] b) {
		        return Double.compare(b[1], a[1]);
		    }
		});
		
		docID = new int[final_score_index.length];
	
		//return the index of ranking the document
		for (int i = 0; i < final_score_index.length;i++)
			docID[i] =  (int) final_score_index[i][0];
		
//		for (int i = 0;i < final_score_index.length;i++){
//			 	System.out.print(final_score_index[i][0]+":");
//				System.out.println(final_score_index[i][1]);		
//		}
		 
	}