Ah, I didn't read your comment carefully enough.  Logic for this is obviously more painfully complicated - will study.