updated problem 47