csopl: homework2: question 4