working algebraic optimization