initial BST code