static BoxNode *
median_cut(PixelList *hl[3],
           unsigned long imPixelCount,
           int nPixels)
{
   /** SKIPPED */

   h=ImagingQuantHeapNew(box_heap_cmp);

   /** SKIPPED */
 
   ImagingQuantHeapAdd(h,(void *)root);
   while (--nPixels) {
      do {
         if (!ImagingQuantHeapRemove(h,(void **)&thisNode)) {
             printf("Leak will be here!?");
            goto done;
         }
      } while (compute_box_volume(thisNode)==1);
      if (!split(thisNode)) {
          /** SKIPPED */
      }
      ImagingQuantHeapAdd(h,(void *)(thisNode->l));
      ImagingQuantHeapAdd(h,(void *)(thisNode->r));
   }  
   
done:  
   ImagingQuantHeapFree(h);
   return root;
}
