brute force loop fixed