Removed recursion from function, now only generator.