IE10 fix

The syntax of the for loop needed to be altered slightly, as IE10 wasn't binding any of the events. This format has been tested in IE10 and Firefox. It should work with other browsers too, as it is reverting to an older for loop style.