added test for problem 39