use a for loop for ie compat and performance