add rules and link