resize temporary array as we reduce it