Well, that's just how I would probably do it. I'm not a coder, so I'm sure there are better ways.
Wow.
Very impressive Gareth.