rewrote LCA algorithm for BST