isBST and some modifications