modified problem #8