public K getMax(){
        K maxKey = null;
        Double maxValue = Double.valueOf(Double.MIN_VALUE);
        for (Map.Entry<K, Double> entry : map.entrySet()){
            //if this value is greater than the maxValue found so far
            if (entry.getValue().compareTo(maxValue)>0){
                maxValue = entry.getValue();
                maxKey = entry.getKey();
            }
        }
        return maxKey;
    }