Added add_branch function.