adding Rule class to base.py