change lbfgs to using Arrays instead of vectors