Agreed; this was left-over from previous work, and was modified beyond original intent.  I think just using Y.merge above is much cleaner.