branching and comparing