only write out filled portion of arrays