find_fit implementation