added extend_heap