@Override
    public double evaluate( String query,
        HashMap < Integer , Double > query_relevance, // r
        ArrayList<ScoredDocument > query_rank){ // my ranking
    	
    	// Make sure this is iterating over the correct list
    	Iterator<ScoredDocument> it = query_rank.iterator();
        double recall = 0.0; 
        double RR = 0.0;
        double R = 0.0;
       
        for(int i = 0; i < query_rank.size(); i++){
            ScoredDocument doc = query_rank.get(i);
            if(query_relevance.containsKey(doc._did)){
                double rel = query_relevance.get(doc._did);
                if (rel >= 5.0 && i < K){
                    RR++;
                }
                if(rel >= 5.0) R++;
            }
        }
        if(R == 0.0){
            recall = 0;
        }
        else{
            recall = RR / R;
        }
        return recall;
    }