Write a method that adds an element after the first and another before the last element of a nonempty linked list, using a list iterator.