solve problem #9