Recursive version.