Update to the get_branches function