Fixed small ordering bug.
Refactoring to remove wrongly coded rules (based on wrong tree).
Autopep8 on rules.py.