renamed iteration index to avoid jshint issues