swapping and partial add