This is right, with python heapq