delete functionality that changed the tree