getRules function added