added swap view function to router