Problem 31 solved