update binary search tree