Add commenting to the trie code.
Don't re-use input variable.

Ugly, bug-prone, ick.