JSHINT: Creating global 'for' variable. Should be 'for (var ...'.