Instead of looping I would write explicitely the two statements you expect coming out from this loop.