class exercises for iteration