modify problem 3