Another approach to breaking out of a nested loop is to factor out both loops into a separate function, and return
from that function when you want to exit.
Of course, this brings up the other argument of whether you should ever explicitly return
from a function anywhere other than at the end.