CF stack instead of recursion