def __compare_sort_handler__(compare):
    """
    Handle sorting of scores.

    :param compare: Compare
    :type compare : pycm.Compare object
    :return: (max_overall_name,max_class_name) as tuple
    """
    sorted_by_class = sorted(compare.scores, key=lambda x: (compare.scores[
        x]['class'], compare.scores[x]['overall']))
    sorted_by_overall = sorted(compare.scores, key=lambda x: (compare.
        scores[x]['overall'], compare.scores[x]['class']))
    sorted_by_class.reverse()
    sorted_by_overall.reverse()
    compare.sorted = sorted_by_class
    max_overall_name = sorted_by_overall[0]
    max_class_name = sorted_by_class[0]
    return max_overall_name, max_class_name
