Change if to while in ex1 and ex2