added test for problem 40