this is for balanced binary tree