problem 39 and validation