Solving a system of linear equations