implement and test update heap