modified Balanced Binary Tree