heap demo code