update swap method