swaps and comparisons