move brute force algor to new func