problem 18 solution added