While loop now is handled