rewrite heap_insert()