there are always other ways to do these things!

anyway this solution requires a function that can be told a few factors rather than one that works out what to do, the first version will be a sight easier to construct.

i can develop the pseudo code first

and if it makes sense WE can build the code

how does that grab you?