updated to save off the rules determined to a file