basic binary tree utility