swapRows method implemented