solved exercise 2.1