almost fixed the gauss solver, some bug still in there