Add swap funtion