Creating the optimizer