changes from while to for loop in books