MOD-Maps algorythm