Changed solver formatting and now only call factorize when necessary.