Modified heap.py