k-way merge working