Swap clean() algorithm