remove unused variables.
do all num cloning after swaps