solved exercise 2