added some commets to delete function