# create a new node
new_node = Node(value)
# point new node to the current head
new_node.next = head
# make new node the new head
head = new_node
# create a new node
new_node = Node(value)
# point the current tail to the new node
tail.next = new_node
# make the new node the new tail
tail = new_node
# point the head to the next node
head = head.next
# traverse the list until the node before the tail
current_node = head
while current_node.next != tail:
current_node = current_node.next
# point the current tail to None
current_node.next = None
# make the node before the current tail the new tail
tail = current_node
current_node = head
while current_node is not None:
# do something with current_node.value
current_node = current_node.next