Start implementing rules generator; Create a rules return method, so
that generated rules list can be easily accessed externally.
Minor fixes