def all_different(L):
    """ Utility function to check that all values in the list are different """
    isinstance(L, list)
    result = set()
    for value in L:
        if value not in result:
            result.add(value)
        else:
            return False
    return True