balanced binary tree revised