Assignment 3 problem 3