Added the option to cut out of the loop early when testing