Function add in max_branch