added swap support