Modify add and delete tasks to use array methods