solved exercise 1-12