Removed lot of bloat code in optimize tree.
objective functions(the ones called by fminunc)
Tried paralellizing by removing all global variables.
But still does not work.