optimize remove_heap to O(1)