added algorithm for parallel merge