can't you preallocate newX to avoid the list to array ?