JSLint: Move 'var' declarations to the top of the function.
```
for (var c = 0; c < children.length; c++) {
    ^
```