wrong order of looping
scripted update of code from master at 5fa2541 wrong order of looping