rewrite bst method