Typo.
More robust looping.
Formatting.
JavaScript code reduction, additional obscuration.