(Note: Apologies to anyone who read my previous post from half an hour ago- I\'ve realised that I posted the wrong half of the code, and it was actually the second half that was