added MatrixNotSquareError to the inverse function