Changed if and while to use multi-closures rather than multiple single closures.