sort and cmp moved