adding k-way merge