You should be able to take his example and expand it for your purposes. We obviously can't write all of your code for you. The function he wrote is almost completely self-contained. Just call it for every set of values you need and use its return value to determine if it's acceptable.