added basic branching