Removed the class OptimizationTask and replaced it with a function call. Communication with the gui thread can be accomplished with the function howToContinue in the OptimizationParams.