finished chapter 8. for loop, while loop