proper recursive extending of arrays