some changes in optim
some changes in optim