sets up delete function