Complete Gauss-Jordan elimination; needs tidying up