solved exercise 1.2