Cascading Order

3. Sort by order: if two rules have the same weight, the latter specified wins.

The search ends when one rule has a higher weight than the other rules.