implemented a deletion function, which deletes nodes in a binary search tree