add rules and class rules