Rewritten lddmc_join