rearrange map pop, distincting