Finished problem 31