update function InsertIntoHeap