rewrote swapping without toching the id