Fixed swapRows function to include a[j][n + 1]