python break out of nested for loops