problem 67 solved with code from problem 18