fix duplicate removal in domain

the bubble sort were buggy (forget kk = kk -1 )