def sort_dict(dictionary):
    """utility function that from a dictionary returns a list of tuples ordered by dictionary values"""
    d = dict(dictionary)
    l = []
    for key in d.keys():
        l.append((d[key], key))
    l.sort(reverse=True)
    return l