CA Assignment 1, problem 2