Founda  way to get optimal paramters. TODO: Timing and thread communication child-parent.