brute force is quite slow, but it works!