Implemented functionality to choose which branches to follow