New while loop added