change lesson 3 to for loop