@Override
  public void reduce(IntWritable key, Iterable<Text> values,
      Context context)
      throws IOException, InterruptedException {
    
     Map<String, Double> temp= new HashMap<String, Double>();
    for (Text value : values) {
        
        String countryName = value.toString();
        if(temp.containsKey(countryName)){
            double count= temp.get(countryName)+1;
            temp.remove(countryName);
            temp.put(countryName, count);
        }else {
            temp.put(countryName, 1.0);
        }     
    }
    Map<String, Double> sortedMap = sortByComparator(temp, DESC);
    Map<String, Double> ratioMap = getRatio(sortedMap);
    Gson gson = new Gson();
    String result = gson.toJson(ratioMap);
    
    context.write(key, new Text(result));
  }