simplified problem 8