largest BST logic explained