Use do/while instead of while with break control