heap function test