currently not optimally implemented. For robustness and accuracy we should use SVD to solve the revert