cleanup mmm2d and elc