iterator's while to for