changing prepend to addFirst and append to addLast