use branches method