first working version on native, without supression non max edges