Finished problem 39