Phase 4 Solution: Branching sequences added.