Implemented better solver for the linear system
Merge branch 'linear_system'