@Override
	Double computeNdcg(ArrayList<String> goldRanking,ArrayList<String> myRanking, int at) {
		ArrayList<Double> myRankingRelevance = new ArrayList<Double> ();
		
		//add relevance values to myRanking
		int size = goldRanking.size();
		boolean flag = false;
		for (String title : myRanking){
			
			for (int i=0; i<size; i++){
				if (goldRanking.get(i).equals(title)){
					
					//debug
					//System.out.println("hit!!");
					
					double gain = calculateRelevance(i);
					myRankingRelevance.add(gain);
					flag = true;
					break;
				}
			}
			if (!flag) myRankingRelevance.add((double) 0);	
			flag=false;
		}
		
		ArrayList<Double> goldenRanking = new ArrayList<>();
		for (int i= 0; i<50; i++){
			double gain = calculateRelevance (i);
			goldenRanking.add(gain);
		}
		
		ArrayList<Double> dgNorm = computeDG(goldenRanking);
		ArrayList<Double> dcgNorm = computeDCG(dgNorm);
		
		//put missing 0 to make sizes equal
		int rankSizeGold = goldenRanking.size();
		int rankSizeMy = myRankingRelevance.size();
		if (rankSizeMy < rankSizeGold){
			int i = rankSizeGold - rankSizeMy;
			for (int j = 0; j< i; j++)
				myRankingRelevance.add((double) 0);
		}
				
		ArrayList<Double> dg = computeDG(myRankingRelevance);
		ArrayList<Double> dcg = computeDCG(dg); 

		ArrayList<Double> ndcg = computeNDCG(dcg, dcgNorm);
//		Collections.sort(myRankingRelevance);
//		Collections.reverse(myRankingRelevance);
		
		
//		
		
		// TODO Auto-generated method stub
		return ndcg.get(at-1);
	}