moving dynamic arrays from pass-by-reference to pass-by-value