solved exercise 1.7