solved exercise 3 thru problem 4b