Added problem 39 sol