merging sorted arrays