for loops improvement