#35 Updated az loop logic to check before loops so as to only require the if statement being checked once per function call.