Finished building the tree and the foundation for encoding and decoding.