Hello there.
This topic was discussed at length over here: Replace Loops using Recursion -1 explanation
Hope this helps