broken code-scrap from while ago
problem 7 solution