Started to rework to account for how to order the tree based on values. Work in progress.