modified max heap