fixed gauss-jordan alg