implemented mergeTwo