Adding function to get rules.