Modified the tree generation algorithm
Length field generation and labeling