ex8 solution