What i'm seeing is:
Iteration 1:
1st feature goes in, global variable set to a. Needs to be looped.
2nd feature goes in, variable appended to a, b. Needs to be looped.
3rd feature goes in, variable appended to a, b, c. Needs to be looped
Iteration 2:
1st feature goes through loop, yet variable's value is a.
2nd feature goes through loop, its variable value is b.
This is likely following the flow of features yet the log file is extremely confusing as it shows the processing via iterations rather than tracing a single feature through all iterations.