add the brute algorithm I used in class