brute force function works now