update deheap code