Updated for loop, with code generation. Issues with integrating lenght. Restoration of the length element
Mearge complete