solved exercise 4