conditionally swap a vector of 4 items