made a static version of the heap routines that can be included without linking