solve problem #8