u can create on array outside the loop and store incrementally a bounding box property in each element. u dont have to create a new array each time.