bug fix - if zero was a value in the domain, results were messed up
optimization - ingore empty rules