Dynamic array to array