Exercise: Loops and Functions

Second part of exercise.