Removed optim dependence