Fixed contains method for BST