brute force method