solved exercise 2 1-4