index the js vars so they don't step on each other in the loop