first draft of complete rule engine (without "not" and only one rule)