problem 31 solved