assignment2 - problem 3