I've highlighted the only way out of the inner loop. But in general it is not principal.