Added a way to find best parameters for some functions.