def getVal(key, argdict):
    """auxiliary function: return the value associated with key in argdict, 0 if key is not a key of argdict"""
    try:
        return argdict[key]
    except KeyError:
        return 0