Use return to break out of nested loop