Create while for if