-Added a better optimizer, improving the optimization time by a factor
of 4