Added better branching