trying a new approach to the delete function