Added documentation to rules.py