updated problem 6