Problem 13 recursive method update