If you are trying to understand recursion, I strongly advise that you step through your code using a good debugger. In this video (which is taken from my course on Recursion), I explain how to use your debugger to see exactly what is going on when functions call themselves.