While loop connected to the surrounding statements