Write to the main array rather than the short-lived  var