finished the delete functionality