An implementation of balanced k-way sort merge