intial partial query trie implementation