added node swapping