I saw this problem and came up with a solution so i coded it up (p067) this solution will now also solve p018.