changed to xor-swap, no need for temp var