added hw2 prob 4