exporting non-public API
use equals instead of ==
fix addRule method