Using mergeArray rather than just appending