simplified problem 31