First implementation, recursion.