CSoPL: homework2: question 2