Added flow logic for WHILE loops.