finished problem 31