solved exercise 7