do not iterate over arrays with `for in` loop, it is slower and will not work if Array.prototype is modified
use 
```js
var state = Rules[currentState]
for(var k = 0; k < state.length; k++) {
    var rule = state[k]
}
```