added swap crystal functionality