speed up solve with faster subs and by loading solver only once