def get_unassigned(values:dict, unassigned:dict):
    """
    Select Unassigned Variable 
    It uses minimum remaining values MRV and degree as heuristics
    returns a tuple of:
    unassigned key and a list of the possible values
    e.g. ('a1', [1, 2, 3, 4, 5, 6, 7, 8, 9])
    """
    
    values_sort = dict() # empty dictionary to store length of possible values array

    for key in values.keys():
        length = len(values[key]) # get the length of possible values array 
        values_sort[key] = (length) # add to dictionary for sorting in next step

    # sort the dictionary including lengths of possible values from small to large
    # this is to later on assign the items with the minimum number of remaining values first
    values_sorted = dict(sorted(values_sort.items(), key=lambda item: item[1], reverse=False))

    for key in values_sorted.keys():
        if unassigned[key] == True:
            length = values_sorted[key]
            if length > 1:
                vars = values[key]
                return key, vars