slightly change the weakupdate method in abstractheap class