moved some helpers into eqn_solver