Using recursion instead of while loop.