solved exercise 2.3a