completed recursion example