added a function to recursively insert an element into the BST