Added k-way merge.