Adding the optimizer