Tweaks to get the loop running faster