I think it would be clearer for this to be an `attempt_count` counter that is always incremented at the top of the loop.