Get the rules in the correct order