I assume this ends up being the last element in the array?  @shunter can chime in if I'm wrong, but it shouldn't be set until after the for loop, because it's faster to grow the array in order, rather than setting values way out of bounds.  I'm also confused as why you wouldn't just do a simple push after the loop, rather than calculating it up front.