Out of curiosity, why did you reverse the loop and test ?