added solution to exercise 12