First functioning linear solver