Fine I've given up - this is probably a better way to do it anyway