Recursion with lazy functions