Added the ability to swap Matrix A and Matrix B.