Optimization methods, still not functioning