Added swap function to the vector.