removed redundancy in trie.scala