wrote removeFirst and removeLast