A few performance tweaks, lists are faster than tuples. Tries are very slightly faster than dict based trees.