balanced tree checker