minor tweaks for for loop