an alternate approach to edit and delete