add some reference and fix optim