csopl: homework 2: question 3