solved exercise 1.8