def merge_dicts(d1, d2):
    """ Function to merge two dictionaries.

    INPUTS
    ======
    d1 : dictionary
    d2 : dictionary

    OUTPUTS
    =======
    dnew : new dictionary that is a combination of d1 and d2

    """
    dnew = d1.copy()
    for key in d2:
        if key in dnew:
            for item in d2[key]:
                if item not in dnew[key]:
                    dnew[key] = dnew[key] + [item]
        else:
            dnew[key] = d2[key]
    return dnew
