private void calculateTfIdf() {
        for(Entry elem: index.entrySet()) {
            HashMap<Integer, Integer> map = (HashMap<Integer, Integer>)elem.getValue();
            HashMap<Integer, Double> id_tfIdf = new HashMap<>();
            for(Entry pair: map.entrySet()) {   
             double tfIdf = (double)((Integer)pair.getValue() * 
                     Math.log(((double)FREE_DOC_ID/(double)map.size())));
             id_tfIdf.put((Integer)pair.getKey(), tfIdf); 
            }
        tf_Idf.put((String)elem.getKey(), id_tfIdf);
       }
    }