naive implementation of BST