added hw1 problem 4