Adds and implements rules.