Added branching functionality