Fix the Brute algorithm