edits while working on delete method, and now it works so code is updated