updated problem 3.