def in_d(key, dic, return_if_false=None):
    """Checks if key is in dic. returns corresponding value if key is found;
    returns None (default) or return_if_false (if specified) otherwise"""
    if key in dic:
        return dic[key]
    else:
        if return_if_false is None:
            return None
        else:
            return return_if_false