switch out array.map for a for loop for 1.2 compatibility