Reduce statement and while loop added