implement the delete functionality.