solutions for section_8b and section_8c