Matrix L added and swapRow method modified