Brute force. Runs rather slowly.