refactoring plane_trie_build
half trie sketch