change lesson 2 to for loop