updated merging with MDL code