@McNets - Check out my answer to our little array problem
here - I sweated blood over this one! :-) Still, I managed to do it without any extensions, functions or C code! I'm having a bit of bother with the UPDATE though - you can take a look
here if you're interested. I'll be posting your (très élégante!) function approach tomorrow as a community wiki!