let replace heap elt =
       match elt with (pos,_,_) ->
         remove heap pos;
         insert heap elt