What happens if there's only one node? The while loop won't run at all and both lag_behind and node will refer to first_node.