MAINT: switch to heapq