refactor tree height
moved closer to correct tree node position calculation