Gauss solve method