Improved the branch algorithm, increasing sensitivity