Nice use of recursion.