adding the optimizer code and the lib