OK - I've applied this. I added a 'base' value within the array and some #defines to try to make the code easier to understand. Hopefully I didn't introduce any bugs during that process. Alasdair