finished brute force version, still need to test on data