Solved problem 18 (and consequently 67)