implemented the delete functionality.