adding functionality to swap rows