add heap functions