added swap.c
tweaked swap.c