Fixed brute force function, now sucessfully solves expert level puzzles.