add swap function, damn it