while loop added