#5: properly call class methods to build tree