added ability to choose local minimzer. Options are bfgs, lbfgs, and cg.