solved Problem 67 in the same way as Problem 18