small tweaks to loops