cleaned up swap.h and swap.c