added rpSwap to dgen