made swap a static method