Completed exercise 2 but still unclear on the answer

I ran this code to try to understand what is happening (below). As you
can see from the output, in the second method call, the before number
and after number lines are not part of the output. So obviously in some
way the method is arriving at the number 2.

I had hoped this technique would shed more light on why it is doing what
it is doing, but unfortunately it did not.