modified problem 3