Trie refactored - now stores searched values