The arguments are stored as a trie using python dictonaries. Each node is a class consisting of two functions and a dict representing a subtree. One function is a check on the length of the arguments, and the other is the function executed on the list of arguments. pseudocode ---------- ``` def addargs(dict, h::[], chk, f): if dict[h] exists: throw exception dict[h].chk = chk dict[h].f = f dict[h].subtree = {} def addargs(dict, h::t, chk, f): if dict[h] does not exist: dict[h].chk = None dict[h].f = None dict[h].subtree = addargs(dict[h].subtree, t, chk, f) def execargs(dict, h::t): if dict[h] exists: f,args = execargs(dict[h].subtree, t) if f,args is None,None: if not dict[h].chk(t): return None,None return dict[h].f,t else: return f,args else: return None,None ```