added algorithm that merges two sorted arrays into one.