need to code brute force-LGS