Removing diagonal swaps