added a brute force frequency checking