implement merge-sort using heapq