Many thanks Paul, I don't completely understand the logic behind this, but it works