If the code compiles and works, it means the code is correct... Something you should check yourself... I don't mean to be rude, but you have a billion examples of the trie usage and once you understand the header of natives, you should have more confidence and test by yourself.