update rules
fix index
fix all rules and some linkage