Solving linear system