finished hw3 prob 2