fixed tree balancing