58ae94af4c
the old implementation modifies the loop variable in the loop. Though it actually works, it is really confusing. Makes it morereadable now.