building the binary search tree