added solution to problem 31