solved exercise 2.2