construct BST