made rule_resolve better
merged and changed pipeline