working version of add swap