problem-8 solution