hopefully working BST code