fixes, tree balancing, visualization