def unionDictsMaxOnCollision(d1, d2):
    """unions d1 and 2 always choosing the max between the two on a collision"""
    newD = d1.copy()
    for k2, v2 in d2.items():
        if not k2 in newD or v2 > newD[k2]:
            newD[k2] = v2
    return newD
