Trie explore method modified for serialization of data