moved some helper methods to eqn_solver