more tweaking of mmo.diag algorithm
added mask_slices