Implement delete function