Can you `break;` here instead of checking `good` on each iteration?