swap correctly