changed linalg module to use sparse solve, much better