Added solution to exercise 12.