fixed bug in expo function and added swap rows method and example