integrated the new version of the function for optimizing the alpha parameter