Gauss-Jordan elimination algorithm seems OK.