modified else behavior for while, for loops