Rewritten for clarity

Sorry just had another look and realised the whole thing could be clearer.