This returns "NonInvertible Matrix" before error.
This is final version. Works.