problem 12 solution