updated problem 3