Working on getting the correct algorithm.
The rule function returns values other than 1 or 0.