def addDictionary(toUpdate, toAdd, initVal=0, mergeFunc=lambda x, y: x + y):
    """
        Defaults to addition, technically applicable any time you want to
        update a dictionary (toUpdate) with the entries of another dictionary
        (toAdd) using a particular operation (eg: adding corresponding keys)
    """
    for key in toAdd:
        if key not in toUpdate:
            toUpdate[key] = initVal
        toUpdate[key] = mergeFunc(toUpdate[key], toAdd[key])
